ID:               45797
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jketterl at chipxonio dot de
-Status:           Open
+Status:           Bogus
 Bug Type:         MySQL related
 Operating System: linux (debian)
 PHP Version:      5.2.6
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

That's due to the architecture of PHP, you should use different
connections in different processes else you get all different kinds of
random results, and connecting to a MySQL daemon is a quite cheap
operation.


Previous Comments:
------------------------------------------------------------------------

[2008-08-12 11:46:21] jketterl at chipxonio dot de

Description:
------------
When forking a php skript using pcntl_fork, the PDO connections to a
MySQL server are lost as soon as one of the processes exits (parent or
child, which ever exits first) and the remaining process can't continue
to execute queries (or, even worse, is interrupted during an active
query).

the code to reproduce is a CLI script as the application i'm working on
is one too. you will need to replace username & password. also, I had to
change the file extension in order to make it downloadable.

Reproduce code:
---------------
http://www.djmacgyver.net/files/test2.php.txt

Expected result:
----------------
before fork
records returned: 1
child
records returned: 1
parent
records returned: 1
after fork
records returned: 1
end

Actual result:
--------------
before fork
records returned: 1
child
records returned: 1
parent
records returned: 1
after fork
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
#0 /home/jketterl/public_html/me/application/import/test2.php(5):
PDO->query('select * from p...')
#1 /home/jketterl/public_html/me/application/import/test2.php(41):
doQuery(Object(PDO))
#2 {main}
end



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


-- 
Edit this bug report at http://bugs.php.net/?id=45797&edit=1

Reply via email to