Information: MySQL version 4.0.20. The table S1 and follow_up are MyISAM type.
mysql> lock tables follow_up write, S1 write;
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT follow_up (reg_no) SELECT S1.reg_no FROM S1 LEFT JOIN follow_up ON
S1.reg_no=follow_up.reg_no WHERE follow_up.reg_no IS NULL;
ERROR 1100: Table ‘follow_up’ was not locked with LOCK TABLES
If I use the following locking methods, they can not help yet.
- lock tables follow_up as S1 write;
- lock tables S1 as follow_up write;
- lock tables follow_up write;
How to lock these tables? Thanks!