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

Bug #16147 First prepared statement is emulated when using factory with mysql
Submitted: 2009-04-24 08:24 UTC
From: purdue Assigned: quipo
Status: Closed Package: MDB2 (version 2.4.1)
PHP Version: Irrelevant OS: Linux
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 : 35 - 31 = ?

 
 [2009-04-24 08:24 UTC] purdue (Randy Williams)
Description: ------------ If you use "factory" instead of "connect", to defer opening the database connection until the first actual operation on it, and if the first operation is a prepared statement, this first operation will be emulated, even if the database supports prepared statements. The problem is that "prepare" checks for prepared statements being supported before doing the connection, and only doing the connection will set up whether prepared statements are supported or not. Test script: --------------- Basic idea: $mdb2 = MDB2::factory(...); $stmt = $mdb2->prepare(...); $stmt->execute(...); Using the debug option, you can see it emulating the first prepare/execute, then using the database for all others. Expected result: ---------------- I expect that it should let the database do the prepare/execute on the first operation too, if the database supports it of course. Actual result: -------------- Debug option shows simple statement emulation on first prepare/execute, and much more complex database statements on all the rest.

Comments

 [2009-09-27 15:23 UTC] quipo (Lorenzo Alberton)
-Status: Open +Status: Closed -Assigned To: +Assigned To: quipo
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.