cast int for offset and limit

This commit is contained in:
Cody Covey 2013-10-30 01:26:03 -05:00
parent 9e40cc5268
commit f3370110b3

View File

@ -91,14 +91,14 @@ class SQLServer extends Grammar {
unset($components['orderings']);
$start = $query->offset + 1;
$start = (int) $query->offset + 1;
// Next we need to calculate the constraint that should be placed on
// the row number to get the correct offset and limit on the query.
// If there is not a limit, we'll just handle the offset.
if ($query->limit > 0)
{
$finish = $query->offset + $query->limit;
$finish = (int) $query->offset + (int) $query->limit;
$constraint = "BETWEEN {$start} AND {$finish}";
}
@ -137,4 +137,4 @@ class SQLServer extends Grammar {
return '';
}
}
}