Bug #16147 [Opn->Csd]: First prepared statement is emulated when using factory with mysql

From: Date: Sun, 27 Sep 2009 10:23:01 +0000
Subject: Bug #16147 [Opn->Csd]: First prepared statement is emulated when using factory with mysql
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-1744@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16147&edit=1 ID: 16147 Updated by: l.alberton@quipo.it Reported By: purdue at nc dot rr dot com Summary: First prepared statement is emulated when using factory with mysql -Status: Open +Status: Closed Type: Bug Package: MDB2 Operating System: Linux Package Version: 2.4.1 PHP Version: Irrelevant -Assigned To: +Assigned To: quipo Roadmap Versions: New Comment: -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. Previous Comments: ------------------------------------------------------------------------ [2009-04-24 04:24:49] purdue 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. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16147&edit=1

« previous php.pear.bugs (#1744) next »