As an example, with this script;
mysql_query("LOCK TABLES mytest WRITE;");
for ($i = 1; $i < 100000; ++$i) {
mysql_query("INSERT INTO mytest (Value, Value2, Value3) VALUES ($i, $i, $i);");
}
mysql_query("UNLOCK TABLES;");
What happens if the script timeout / user computer crashes / something before the stage UNLOCK TABLES? Will mysql “notify” that the client requesting the lock has disconnected and canceled the lock accordingly, or will it be stuck indefinitely?
natli source
share