Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

determine if a table is Locked?

Status
Not open for further replies.

shadedecho

Programmer
Oct 4, 2002
336
US
Ok, thread "A" issues a "LOCK TABLES `mytable`" command, and then starts doing its thing... now, thread "B" wants to read from `mytable` using a select... if that command is issued, mysql will cause that statement to WAIT until the table is UNLOCK'd before executing, which is good.

Is there a way to SHOW TABLE STATUS, or DESCRIBE it, or something like that, to find out (BEFORE trying to read it) if it is locked? like, if your script could write/read from another table if this one was being used, etc. is there a way to determine that using SQL without having to wait for the LOCK to be undone?
 
I don't know if it helps you directly but it should point you in the right direction


By the way

SHOW TABLE STATUS from DB works although the info provided is quite basic


However, if you convert your tables to InnoDB then you can have different process accessing the table at he same time as locking would be at row level and not table level.

Bye

Qatqat The reason why my girlfriend can read my thoughts is because mine are properly written! (G.Lepore)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top