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

Bug #16139 The compiler doesn't support insert without column_names.
Submitted: 2009-04-22 17:00 UTC
From: mcmic Assigned: alan_k
Status: Closed Package: SQL_Parser (version CVS)
PHP Version: 5.2.5 OS: Ubuntu GNU/Linux
Roadmaps: (Not assigned)    
Subscription  


 [2009-04-22 17:00 UTC] mcmic (MCMic phoque)
Description: ------------ It's really easy to correct, that's just that the compiler call an implode function which doesn't work "Warning: implode() [function.implode]: Invalid arguments passed in /usr/share/php/SQL/Compiler.php on line 271" and put empty parenthesis when it receive an insert without column_names like "INSERT INTO table1 VALUES (1,"test 1");" It should check if the column_names array exist in the tree/array. Test script: --------------- <?php require_once 'SQL/Parser.php'; require_once 'SQL/Compiler.php'; $parser = new SQL_Parser(); $compiler = new SQL_Compiler(); $req = $parser->parse("INSERT INTO table1 VALUES (1,'test 1')"); echo $compiler->compile($req); ?> Expected result: ---------------- insert into table1 values (1, 'test 1') Actual result: -------------- Warning: implode() [function.implode]: Invalid arguments passed in /usr/share/php/SQL/Compiler.php on line 271 insert into table1 () values (1, 'test 1')

Comments

 [2009-04-22 17:56 UTC] mcmic (MCMic phoque)
The following patch has been added/updated: Patch Name: CompilerInsertPatch Revision: 1240405006 URL: http://pear.php.net/bugs/patch-display.php?bug=16139&patch=CompilerInsertPatch&revision=1240405006&display=1
 [2009-05-11 14:48 UTC] mcmic (MCMic)
The following patch has been added/updated: Patch Name: CorrectPatch Revision: 1242035321 URL: http://pear.php.net/bugs/patch-display.php?bug=16139&patch=CorrectPatch&revision=1242035321&display=1
 [2009-05-11 14:54 UTC] mcmic (MCMic)
-Package Version: 0.5 +Package Version: CVS
 [2011-02-14 10:21 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Closed -Assigned To: +Assigned To: alan_k
This bug has been fixed in SVN. 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.