Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #3666 getOne/getRow optimization causes query error
Submitted: 2005-03-02 09:55 UTC
From: t dot fritsche at webmasterorder dot de Assigned: danielc
Status: Closed Package: DB
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 28 - 10 = ?

 
 [2005-03-02 09:55 UTC] t dot fritsche at webmasterorder dot de
Description: ------------ The optimization changes made to the getOne and getRow simply append the string LIMIT ... to the query. If someone has queries where getOne/getRow was used and there is a semicolon at the end of the query. These queries will result in a SQL Syntax error, because the "LIMIT 0,1" will be appended after the semicolon. Reproduce code: --------------- $result = $db->getOne("SELECT col FROM table;"); if (DB::isError($result)) { $result->getDebugInfo(); } else { echo $result; } Expected result: ---------------- The first column returned from table. Actual result: -------------- [nativecode=1064 ** You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; LIMIT 0, 1' at line 8]

Comments

 [2005-03-02 14:31 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-02 14:44 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-03-04 23:24 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!