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

Bug #13403 Parser does not accept arbitrary expressions in JOIN clauses
Submitted: 2008-03-16 07:59 UTC
From: bakert Assigned: cybot
Status: Closed Package: SQL_Parser (version CVS)
PHP Version: 5.2.1 OS: Mac OS X 10.4
Roadmaps: (Not assigned)    
Subscription  


 [2008-03-16 07:59 UTC] bakert (Thomas Baker)
Description: ------------ A minimal example is: "SELECT x FROM y INNER JOIN z ON y.a + 1 = z.a" which is legal MySQL but gives: "Parse error: Expected an operator on line 1 ... [SQL here] ... found '+'". Test script: --------------- $sql = "SELECT x FROM y INNER JOIN z ON y.a + 1 = z.a"; $p = new SQL_Parser(null, "MySQL"); print_r($p->parse("SELECT x FROM y INNER JOIN z ON y.a + 1 = z.a")); if (isset($p->error)) { print "\n\n" . $p->error_message; } Expected result: ---------------- Parsed query. Actual result: -------------- Parse error: Expected an operator on line 1 SELECT x FROM y INNER JOIN z ON y.a + 1 = z.a ^ found: "+"

Comments

 [2008-03-16 08:09 UTC] bakert (Thomas Baker)
The code that needs to change to accommodate this is around line 659 in Parser.php but I can't quite work out how to do it.
 [2008-07-24 14:49 UTC] cybot (Sebastian Mendel)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.