ZF-11495: Pdo_Mysql limit() method generate " LIMIT ... OFFSET ..."
Description
$oSelect->limit(10,5); result: ... LIMIT 10 OFFSET 5; expected: ... LIMIT 5, 10;
correction: Zend/Db/Adapter/Pdo/Mysql.php
find:
$sql .= " LIMIT $count";
if ($offset > 0) {
$sql .= " OFFSET $offset";
}
replace:
if ($offset > 0) {
$sql .= " LIMIT $offset, $count";
}
else {
$sql .= " LIMIT $count";
Comments
Posted by Francescu GAROBY (f.garoby) on 2011-06-24T09:06:53.000+0000
The MySQL documentation says that the current syntax is correct, and is used for compatibility with PostgreSQL. Why do you want to change it ?
cf. http://dev.mysql.com/doc/refman/5.0/en/select.html
Posted by newARTix (newartix) on 2011-06-24T09:39:13.000+0000
sorry, there was an error in my own code. Please close the issue.