ID: 41997 Comment by: ben at stickyeyes dot com Reported By: nitel_defect at yahoo dot com Status: Open Bug Type: PDO related Operating System: Windows XP SP2 PHP Version: 5.2.3 New Comment:
Just to add to this bug, I too experience this problem when trying to execute two stored procedures, one after the other. Unfortunately, the only work around I could get working, was to create a new PDO object for each query (attempting to clone an existing PDO object caused Apache to crash, but thats another bug for another day...) Sucks, but it works. Apache/2.2.4 (Win32) PHP/5.2.3 PDO Driver for MySQL, client library version 5.0.37 MySQL 5.1.22 Previous Comments: ------------------------------------------------------------------------ [2008-01-22 13:28:59] [EMAIL PROTECTED] Reclassified: mysql -> pdo ------------------------------------------------------------------------ [2007-08-21 00:08:52] marpiotr at gmail dot com i seem to have the same problem on 5.1.6 on Fedora Core 6 ------------------------------------------------------------------------ [2007-07-16 18:06:49] nitel_defect at yahoo dot com http://www.kpsol.ro/php_pdo_mysql.dll ------------------------------------------------------------------------ [2007-07-16 17:30:00] temposeb at free dot fr I encounter exactly the same bug for many months. Environment : Win2000 Pro SP4, Apache 2.2, PHP 5.2.4-dev (Build Date Jul 11 2007 20:03:23), MySQL 5.1.20-beta-community-nt-debug (same thing with MySQL 5.0.x). nitel_defect, where can we find the hacked DLL ? http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll is actually DOWN. Thx. ------------------------------------------------------------------------ [2007-07-15 06:53:01] nitel_defect at yahoo dot com Description: ------------ The code below calls a stored procedure that fethches the whole tree in a father-son system roles hierarchy. In the end, the stored procedure selects everything from a temp table, so that's our result set. PDO::MYSQL_ATTR_USE_BUFFERED_QUERY is on by default. After running the call statement, all the result rows are returned correctly but any future query (not only other calls, all queries) fail with the message you see below. For the time being I replicated the code I needed in PHP, but it's frustrating not to be able to run SPs... I tested the library found here: http://source.hackthissite.org/svn/trunk/PDO/php_pdo_mysql.dll and this bug was gone. But there is no source code for this modified library and its size is much smaller so I don't quite trust it. Uhm... help? Reproduce code: --------------- <?php $db = new PDO('mysql:host=localhost;dbname=2m;port=3306', 'root', '', array()); $st = $db->query("call getParentRoles('admin')"); do { $rows = $st->fetchAll(PDO::FETCH_ASSOC); } while ($st->nextRowset()); $st->closeCursor(); var_dump($db->errorInfo()); echo '<br />'; $st = $db->query("SELECT * FROM user"); var_dump($db->errorInfo()); Expected result: ---------------- array(1) { [0]=> string(5) "00000" } array(1) { [0]=> string(5) "00000" } Actual result: -------------- array(1) { [0]=> string(5) "00000" } array(3) { [0]=> string(5) "HY000" [1]=> int(2014) [2]=> string(269) "Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute." } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41997&edit=1