Permalink
Browse files

* Fixed some slicing bug in the MySQL driver.

  • Loading branch information...
1 parent 4f5a812 commit 6109c2b9a57c0f311504a434db3a8885f70bd775 @OwlManAtt OwlManAtt committed Mar 16, 2008
@@ -163,7 +163,7 @@ public function buildOneOffLimit($condition_number,$limit_number);
/**
* Generate a SQL query to return a slice from a larger result set.
*
- * @param integer $start The position to begin the slice at. Start from 1, not 0.
+ * @param integer $start The position to begin the slice at. Start at 0, not 1.
* @param integer $end The position to end the slice at.
**/
public function setSlice($start,$end);
@@ -285,7 +285,6 @@ public function setSlice($start,$end)
throw new SQLGenerationError('Limit has been set for this query; cannot return a slice.');
}
- $end++;
$total = $end - $start;
$this->limit = "$start,$total";
} // end setSlice
@@ -1055,11 +1055,6 @@ public function findBy($args,$order_by='',$count=false,$slice_start=null,$slice_
if($slice_start !== null && $slice_end !== null)
{
- if($slice_start === 0)
- {
- $slice_start = 1;
- }
-
$sql_generator->setSlice($slice_start,$slice_end);
} // end slice

0 comments on commit 6109c2b

Please sign in to comment.