From 2045c54f5989a87432d3906b17b181233889fbfd Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Thu, 3 Feb 2011 02:11:58 +0200 Subject: [PATCH] Fixed bug in Archive with insert delayed storage/archive/ha_archive.cc: Fixed bug that caused archive.test to fail with: Warning: Found locks from different threads for lock 't2' in 'write' at 'start of release lock'... The reason was that the TL_WRITE_DELAYED lock was changed to TL_WRITE_ALLOW_WRITE which conflicted with how the lock was used in sql_insert.cc (in particular with thr_upgrade_write_delay_lock()) --- storage/archive/ha_archive.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index d0cb34455b9..f052f8ca82f 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1433,12 +1433,13 @@ THR_LOCK_DATA **ha_archive::store_lock(THD *thd, /* Here is where we get into the guts of a row level lock. If TL_UNLOCK is set - If we are not doing a LOCK TABLE or DISCARD/IMPORT + If we are not doing a LOCK TABLE, DELAYED LOCK or DISCARD/IMPORT TABLESPACE, then allow multiple writers */ if ((lock_type >= TL_WRITE_CONCURRENT_INSERT && - lock_type <= TL_WRITE) && !thd_in_lock_tables(thd) + lock_type <= TL_WRITE) && delayed_insert == FALSE && + !thd_in_lock_tables(thd) && !thd_tablespace_op(thd)) lock_type = TL_WRITE_ALLOW_WRITE;