Skip to content

Commit

Permalink
* Fixed some slicing bug in the MySQL driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
OwlManAtt committed Mar 16, 2008
1 parent 4f5a812 commit 6109c2b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion active_table/SqlGenerators/interface.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion active_table/SqlGenerators/mysql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions active_table/active_table.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6109c2b

Please sign in to comment.