MySQL Forums
Forum List  »  Data Recovery

Re: ERROR 1100 (HY000) at line : Table was not locked with LOCK TABLES
Posted by: Michael delos Reyes
Date: October 05, 2021 08:08AM

In the sqldump file:

LOCK TABLES `TABLE_A` WRITE;
/*!40000 ALTER TABLE `TABLE_A` DISABLE KEYS */;
set autocommit=0;
ALTER TABLE `TABLE_A` ADD KEY `TABLE_A_IX1` (`SESSION_ID`);
ALTER TABLE `TABLE_A` ADD CONSTRAINT `TABLE_A_FK` FOREIGN KEY (`SESSION_ID`) REFERENCES `TABLE_B` (`SESSION_ID`) ON DELETE CASCADE;
/*!40000 ALTER TABLE `TABLE_A` ENABLE KEYS */;
UNLOCK TABLES;
commit;

its should be LOCK TABLES `TABLE_A` WRITE, `TABLE_B` READ;

so that I dont get the error:
ERROR 1100 (HY000) at line 74: Table 'TABLE_B' was not locked with LOCK TABLES

Options: ReplyQuote




Sorry, only registered users may post in this forum.

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.