I have some code that does a LOCK TABLE on a table in my database.
After the lock, I do a SELECT from this same table. My mysql API interface gives the following error:
mysqlsel/db server: Table 'Mytable' was not locked with LOCK TABLES
According some googling, this relays to the error code: ER_TABLE_NOT_LOCKED
Why would this code generate this error? I would not expect it to give an error if I do not lock it at all, and I certainly do not expect an error if I lock it either.
I think I solved my own question by ‘RTM’,
I locked multiple tables in separate lock statements,
So if I do:
… a subsequent
SELECT FROM Mytableprobably triggers this error…