From: aloucks at cofront dot net Operating system: Linux 2.4.31 PHP version: 5.2.0 PHP Bug Type: PDO related Bug description: Persistent connections and ODBC
Description: ------------ A warning is generated (SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes) when retrieving connections with the PDO::ATTR_PERSISTENT set to true. A valid and usable PDO object is returned. After 5 calls to PDO::__contruct() with the same parameters the warning goes away and the time to create the PDO object drops from 0.08ms to 0.0004ms. The warning will eventually come back and the connection time will go back up to 0.08ms for a few attempts and then resume back to 0.0004ms. After a fresh apache restart the first 5 connection attempts will always generate this warning. (I assume the pool/cache size is 5) It seems like the connection caching is actually working but a warning is generated when the connection is first established and then again after it eventually times out and a new connection is created. I'm using unixODBC w/ibm iSeriesAccess odbc drivers. This bug seems similar to bug: 39845 (http://bugs.php.net/bug.php?id=39845) but I didn't find any code changes related to it outside the pdo_pgsql dir. Also, I'm not sure if this is related, but PDO::ERRMODE_EXCEPTION, and PDO::ATTR_TIMEOUT also cause warnings to be displayed. I havn't tested any other flags. Connections failures (tested using bad a username) throw exceptions, but sql queries (tested with bad syntax) did not. Reproduce code: --------------- <?php $dbh = new PDO('odbc:dsn', 'user', 'pass', array(PDO::ATTR_PERSISTENT => true)); ?> Expected result: ---------------- The code works but a warning is generated. Actual result: -------------- PHP Warning: PDO::__construct() [<a href='function.PDO---construct'>function.PDO---construct</a>]: SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes in ... -- Edit bug report at http://bugs.php.net/?id=39929&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39929&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39929&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39929&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39929&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39929&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39929&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39929&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39929&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39929&r=support Expected behavior: http://bugs.php.net/fix.php?id=39929&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39929&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39929&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39929&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39929&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39929&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39929&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39929&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39929&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39929&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39929&r=mysqlcfg