Bug #1112 insert delayed and lock tables
Submitted: 21 Aug 2003 7:50 Modified: 27 Aug 2003 13:55
Reporter: Jrme Despatis (Candidate Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.14 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[21 Aug 2003 7:50] Jrme Despatis
Description:
Hello

i don't really know if this is a bug
but i can't do an INSERT DELAYED INTO t1 SELECT FROM t2
where t2 is lock in read mode, and t1 is not locked

How to repeat:
Hello

i don't really know if this is a bug, but watch the commandes:

>LOCK TABLES n4 WRITE;    OK
>SELECT ref_next FROM n4    OK
>INSERT DELAYED INTO n5 (ref_next) VALUES ('4'); OK

but 
>INSERT DELAYED INTO n5 (ref_next) SELECT ref_next FROM n4;
ERROR 1100: Table 'n5' was not locked with LOCK TABLES

and i don't understand, i can write in n5, read from n4, but impossible 
to
do this...

it's a feature or a bug ?

Thanks
enzo
[27 Aug 2003 12:40] Peter Zaitsev
Looks like a bug as at least error message is missleading
[27 Aug 2003 13:55] Sinisa Milivojevic
Not a bug.

If LOCK TABLES is used all invoved tables must be locked.

This is to  prevent deadlocks.