Re: Lock table in MySQL
A table lock protects only against inappropriate reads or writes by other sessions. The session holding the lock can perform read/operation, for example
mysql> show create table t1;
+-------+--------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------+
| t1 | CREATE TABLE `t1` (
`a` char(20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
+-------+--------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> lock table t1 write;
Query OK, 0 rows affected (0.00 sec)
mysql> insert into t1 values (2);
Query OK, 1 row affected (0.01 sec)
Subject
Views
Written By
Posted
4127
July 19, 2010 07:24PM
Re: Lock table in MySQL
2339
July 20, 2010 10:40AM
1873
July 27, 2010 12:44PM
1670
July 26, 2010 11:28PM
1589
September 06, 2010 03:30PM
1838
September 06, 2010 09:51PM
1978
September 06, 2010 10:26PM
2103
September 07, 2010 10:34PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.