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

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

sorry, there was an error in my own code. Please close the issue.