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

Bug #13649 queryAll doesn't free stored procedure result properly with mysqli driver
Submitted: 2008-04-11 08:05 UTC
From: ben Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.1)
PHP Version: Irrelevant OS: irrelevant
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 : 49 - 12 = ?

 
 [2008-04-11 08:05 UTC] ben (Benjamin Taieb)
Description: ------------ given $mdb2 is a valid mysqli connection : $data = $mdb2->queryAll('CALL test.MyStoredProc()'); $data = $mdb2->queryAll('SELECT * FROM test.MyTable'); the second statement get "out of sync" error this is a know problem see http://amountaintop.com/php-5-and-mysql-5-stored-procedures-error-and-solution-qcodo http://www.rooftopsolutions.nl/tag/mysqli This is because a stored proc in mysql 5+ can return multiple resultset. To solve this change line 3358 of MDB2.php file from : $result->free(); to: while($result->nextResult()) $result->free(); TODO : check others place in the code to correct. Test script: --------------- $data = $mdb2->queryAll('CALL test.MyStoredProc()'); $data = $mdb2->queryAll('SELECT * FROM test.MyTable');

Comments

 [2009-12-28 02:51 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
The code in SVN should fix this issue. Please reopen this report if you still experience the bug.