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

Bug #11590 _getServerCapabilities() should be run once per connection, only run once total
Submitted: 2007-07-12 11:14 UTC
From: tschundler Assigned: quipo
Status: Closed Package: MDB2_Driver_mysqli (version 1.4.1)
PHP Version: 5.2.3 OS: FreeBSD
Roadmaps: (Not assigned)    

 [2007-07-12 11:14 UTC] tschundler (Ted Schundler)
Description: ------------ _getServerCapabilities() in the MySQLi driver should be run once per new object (connection). Instead, it is only run once total. Extra connections therefore don't have proper capabilities discovery. Test script: --------------- <? include("MDB2.php"); //to test, replace this with a valid DSN for //a mysql server supporting prepared queries $dsn="mysqli://test:@localhost/test"; $db=MDB2::factory($dsn,array('portability'=>'MDB2_PORTABILITY_NONE')); //need to do some query to make it actually check server $db->query("SET time_zone = '+0:00'"); echo "Prepared? {$db->supported['prepared_statements']}\n"; //reconnect - same server, so capabilities shoud be the same $db2=MDB2::factory($dsn,array('portability'=>'MDB2_PORTABILITY_NONE')); $db2->query("SET time_zone = '+0:00'"); echo "Prepared? {$db2->supported['prepared_statements']}\n"; ?> Expected result: ---------------- Prepared? 1 Prepared? 1 Actual result: -------------- Prepared? 1 Prepared? emulated


 [2007-07-22 13:59 UTC] quipo (Lorenzo Alberton)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the 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.