MySQL Forums
Forum List  »  MyISAM

Re: Lock table in MySQL
Posted by: Aftab Khan
Date: July 20, 2010 10:40AM

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)

Options: ReplyQuote


Subject
Views
Written By
Posted
4113
July 19, 2010 07:24PM
Re: Lock table in MySQL
2329
July 20, 2010 10:40AM
1862
July 27, 2010 12:44PM
1660
July 26, 2010 11:28PM
1575
September 06, 2010 03:30PM
1827
September 06, 2010 09:51PM
1966
September 06, 2010 10:26PM
2094
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.