ID: 26490 Updated by: [EMAIL PROTECTED] Reported By: chris dot noden at monstermob dot com -Status: Open +Status: Feedback Bug Type: MySQL related Operating System: Redhat AS 2.1 PHP Version: 4.3.3 New Comment:
Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try avoid embedding huge scripts into the report. Previous Comments: ------------------------------------------------------------------------ [2003-12-01 13:16:29] chris dot noden at monstermob dot com Description: ------------ MySQL version 4.0.13 running on a different server on the LAN using pconnect: After using a pcntl_fork() the child thread suffers from the "2013 : Lost connection to MySQL server" error above. I can continue to use the MySQL connection without connecting again implying that the connection has miraculously re-established itself! The error can occur at any stage in a query, (eg during submission or reading the results of the query). The error usually manifests itself when the query returns no results. The error comes from the parent process!! I have tried all sorts of workarounds, to no avail. Reproduce code: --------------- do { $sql = "SELECT stuff FROM db WHERE a=b"; $qryID = mysql_query($sql,$Link_ID while (mysql_fetch_array($qryID)) { // Fork off a child $is_parent = pcntl_fork(); if ($is_parent > 0) { // I am the child - do some stuff exit; } else { // I am the parent do some stuff } // end if/else sleep(1); } while (condition); Expected result: ---------------- Normal database flow. Actual result: -------------- Error 2013 - Lost connection to MySQL server during query ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26490&edit=1