|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-20 19:46 UTC] mfischer@php.net
[2001-11-20 20:10 UTC] torben@php.net
[2001-11-20 22:05 UTC] torben@php.net
[2002-06-10 04:08 UTC] mfischer@php.net
[2002-06-10 04:10 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 14:00:01 2025 UTC |
I've heard about this from a couple of sources and been looking for answers, but haven't found anything definitive. I don't even know if it's solvable. However, when using persistent connections and LOCK TABLES, if for any reason the UNLOCK TABLES never gets executed, the server ends up hanging while it waits for the lock to get released. This is reproduceable for me on every version of PHP I've tried. Example script: <?php /* -*- mode: c++; minor-mode: font -*- */ error_reporting(E_ALL); $dbh = mysql_pconnect($host, $user, $pass); /* Just to test the connection. */ if ($res = mysql_db_query($db, 'show tables', $dbh)) { while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) { echo $row["Tables_in_$db"] . "<br>\n"; } } echo "<hr>\n"; $table = 'category'; echo "Locking table '$table' (if the script blocks here, then the lock never got released)...<br>\n"; flush(); if ($res = mysql_db_query('chaps', "lock tables $table write", $dbh)) { echo "OK; locked.<br>\n"; } else { echo "failed; could not lock.<br>\n"; } flush(); //$res = mysql_db_query('chaps', "unlock tables", $dbh) ?> Is this just me?