I would like to check if several tables are locked or not. I tried to do it this way:
SHOW OPEN TABLES WHERE (Table LIKE 'table_name' OR Table LIKE 'table2_name') AND In_use > 0
But i'm getting error
#1064 - You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
'Table LIKE 'table_name' OR Table LIKE 'table2_name') AND In_use > 0' at line 1
I checked that this one works fine:
SHOW OPEN TABLES WHERE In_use > 0 LIKE "table_name"
but i need to check it for several tables and i would like to do it just using one query. I use MySQL in version 5.5.24