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

Bug #11462 generate_testcases.php does not correct split queries
Submitted: 2007-06-28 09:08 UTC
From: cybot Assigned: cybot
Status: Closed Package: SQL_Parser (version CVS)
PHP Version: 5.2.3 OS:
Roadmaps: 0.5.1    
Subscription  


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 : 34 - 18 = ?

 
 [2007-06-28 09:08 UTC] cybot (Sebastian Mendel)
Description: ------------ generate_testcases.php does not correct split queries at least on Windows queries are not splitted by ';' also included in patch is a third command line option, to disable splitting of queries in the given SQL file Test script: --------------- [windows cmd] echo SELECT 1; > test.sql echo SELECT 1; >> test.sql php generate_testcases.php test.sql Expected result: ---------------- <?php $tests = array( array( 'sql' => 'SELECT 1', 'expect' => array( 'command' => 'select', 'value' => array( 0 => 1, ) ) ), array( 'sql' => 'SELECT 1', 'expect' => array( 'command' => 'select', 'value' => array( 0 => 1, ) ) ), ); ?> Actual result: -------------- <?php $tests = array( array( 'sql' => 'SELECT 1; SELECT 1; ', 'expect' => array( 'command' => 'select', 'value' => array( 0 => 1, 1 => ';', 2 => 'SELECT', 3 => 1, 4 => ';' ) ) ), ); ?>

Comments

 [2008-07-24 15:25 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.