Edit report at https://bugs.php.net/bug.php?id=39858&edit=1

 ID:                 39858
 Updated by:         s...@php.net
 Reported by:        develar at gmail dot com
 Summary:            Lost connection to MySQL server during query by a
                     repeated call stored proced
-Status:             Closed
+Status:             Re-Opened
 Type:               Bug
 Package:            PDO related
-Operating System:   Windows XP SP2
+Operating System:   *
 PHP Version:        5.2.0
 Assigned To:        wez
 Block user comment: N
 Private report:     N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2008-09-12 23:02:00] johan...@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.

------------------------------------------------------------------------
[2008-05-02 16:48:43] bepoteat at yahoo dot com

After looking at the PHP manual, I realized I could reduce the loop to a single 
line:

        while (mysqli_next_result($conn));

I didn't even have to use mysqli_free_result (but it is good practice).

------------------------------------------------------------------------


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

Reply via email to