-
Notifications
You must be signed in to change notification settings - Fork 2.5k
getSqlStringForSqlObject() returns an invalid SQL statement with LIMIT and OFFSET clauses #2545
Comments
(Originally posted by: Magnus Berglund on 08/26/12) An attempt at a fix: #2244 |
(Originally posted by: samsonasik on 09/13/12) i think ->execute() func can solve this $statement = $sql->prepareStatementForSqlObject($select); |
This issue was ported from the ZF2 Jira Issue Tracker at Known GitHub users mentioned in the original message or comment: |
This bug is still present in stable 2.2.3 as well as dev-master. Why is that? |
@woyteck If you're still seeing the bug, please provide a reproduce case so we can verify. |
PHP v. 5.4.16 composer.json: global.php: //controller: $select = new Select('test_table'); results in: SELECT The same thing happens when I update to dev-master. |
Caused by library/Zend/Db/Sql/Select.php
Select::processLimit()
|
Bug is still present in Zend Framework 2.2.10. I have to use this version because of running PHP version 5.3.14. |
Jira Information
Description
The getSqlStringForSqlObject() function returns a SQL statement where the integers for the LIMIT and OFFSET clauses are quoted, which is not correct and MySQL returns an exception.
In the model/mapper
$selectString returns
That seems to be an incorrect SQL statement, there should be no quotations around the LIMIT integer
So when executing the query
MySQL returns this exception:
The same thing happens when adding an OFFSET clause, the integer is incorrectly quoted.
The text was updated successfully, but these errors were encountered: