Bug #39858 [Com]: Lost connection to MySQL server during query by a repeated call stored proced

From: Date: Tue, 14 Jan 2014 22:11:31 +0000
Subject: Bug #39858 [Com]: Lost connection to MySQL server during query by a repeated call stored proced
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183797@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=39858&edit=1 ID: 39858 Comment by: gvinaj at hush dot ai Reported by: develar at gmail dot com Summary: Lost connection to MySQL server during query by a repeated call stored proced Status: Re-Opened Type: Bug Package: PDO MySQL Operating System: * PHP Version: 5.2.0 Block user comment: N Private report: N New Comment: Still seeing this issue with Yii framework migrations. Win2008R2 x64, IIS7.5, PHP5.4.9 (tried also 5.5.3), MySQL 5.7.3-m13 Seeing the following error while running Yii migrations that include multiple SQL statements against MySQL: "Fatal error: SQLSTATE[HY000]: General error: 2014 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..." For some reason even the suggested setup with 'PDO::MYSQL_ATTR_USE_BUFFERED_QUERY=true' attribute is not working for me. Any suggested workaround or idea why is not working? Previous Comments: ------------------------------------------------------------------------ [2013-08-11 03:39:36] stas@php.net Still seeing this problem in test bug_39858. See: https://travis-ci.org/php/php-src/builds/10062028 and also on my local Linux, 64-bit, produces this on master: Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /home/smalyshev/php-src/ext/pdo_mysql/tests/bug_39858.php on line 22 Warning: PDOStatement::fetchAll(): SQLSTATE[HY000]: General error in /home/smalyshev/php-src/ext/pdo_mysql/tests/bug_39858.php on line 28 ------------------------------------------------------------------------ [2008-09-12 23:02:00] johannes@php.net This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Fixed when using mysqlnd (Windows default, else, --with-pdo-mysql=mysqlnd) ------------------------------------------------------------------------ [2008-08-28 09:34:01] sakha5413 at gmail dot com Fatal error: SQLSTATE[HY000]: General error: 2014 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. in C:\xampp\htdocs\tshirtshop\business\database_handler.php on line 102 ------------------------------------------------------------------------ [2008-07-21 15:06:16] jpmasseria at hotmail dot com The single line workaround worked for me! while (mysqli_next_result($conn)); Thank you bepoteat! This is much better than my previous workaround which was to close and reopen my database connection before my subsequent stored procedure call. John ------------------------------------------------------------------------ [2008-07-14 15:31:00] ile at suomi dot finland This bug occurs with Apache/2.0.63 (Win32) PHP/5.2.6 and MySQL 5.0.51b. I don't use PDO. I use mysqli calls. The work-around by bepoteat helps though. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=39858 -- Edit this bug report at https://bugs.php.net/bug.php?id=39858&edit=1

« previous php.bugs (#183797) next »