|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-25 15:48 UTC] wez@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 18:00:01 2025 UTC |
Description: ------------ When I'am locking MySQL ISAM table from PHP env, all other threads still can use this table for READ/WRITE actions. But I didn't get from mysql_error() any message, and even cannot access other tables, untill they not locked too. So it's seems like PHP really thinks that MySQL locked. I think that this is problem of PHP because from MySQL console I can lock tables succesfuly, and after this lock even PHP cannot access this table. Reproduce code: --------------- mysql_pconnect("localhost","root",""); mysql_select_db("test_db"); mysql_query("LOCK TABLES `test_table_1` WRITE"); mysql_query("INSERT INTO `test_table_1` (`a`) VALUES (1)"); // returns OK mysql_query("INSERT INTO `test_table_2` (`a`) VALUES (1)"); // Table was not locked with LOCK TABLES sleep(100); mysql_query("UNLOCK TABLES"); Expected result: ---------------- with this code I want to show you that all works fine, from side of thread what lock MySQL table. But really nothing is locked, during this 100 seconds I can edit/read test_table_1, without any problems from other threads. If I will even remove UNLOCK TABLES command and will use presistent connection, I will not hang up system. Because nothing is locked. Actual result: -------------- I tried it on PHP v 4.4.0/5.0.3/snapshots, CLI mode/Apache 2.0.54 compiled as worker/prefork, mysql v 4.1.12,13,14. And everywhere the same picture. I tried to compile PHP in different ways, from --disable-all + some only important keys, to full configs. Also tried to use budle MySQL libraries and what install on system. But all the same. Hope on your fast bug_fix. P.S: Also on this system I cannot flock(file) it all the same like with MySQL, no any error returned, but file no locked for other threads. (FS:ext2)