MySQL Forums
Forum List  »  MyISAM

Re: Problems with error 1100: Table ... was not locked with LOCK TABLES
Posted by: Liu Xian
Date: March 14, 2007 07:57PM

According to what the 5.0 manual said " When you use LOCK TABLES, you must lock all tables that you are going to use in your queries. Because LOCK TABLES will not lock views, if the operation that you are performing uses any views, you must also lock all of the base tables on which those views depend. While the locks obtained with a LOCK TABLES statement are in effect, you cannot access any tables that were not locked by the statement. Also, you cannot use a locked table multiple times in a single query. Use aliases instead, in which case you must obtain a lock for each alias separately.", it seems that the case I have done is right.

If you want to query several tables, you must execute statment like this "lock table t1 read, t2 read,[...]", then you can query them in one session.

Another question:
How to confirm whether or not a table has been locked ?

Anyone advice?
thanks!

Options: ReplyQuote




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.