diff options
author | Alexander Nozdrin <alik@sun.com> | 2009-08-24 10:48:57 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2009-08-24 10:48:57 +0400 |
commit | 8b72c02a2578448a9ac0a16042a6bc142d9d81bb (patch) | |
tree | c599cc8b565035da92c3a7170e15079467578c04 | |
parent | ed1976f1437fd10ec61c5a88a63ecee8d95263ed (diff) | |
download | mariadb-git-8b72c02a2578448a9ac0a16042a6bc142d9d81bb.tar.gz |
Backporting patch for Bug#46650 (Innodb assertion autoinc_lock == lock
in lock_table_remove_low on INSERT SELECT) to mysql-trunk.
-rw-r--r-- | storage/innobase/lock/lock0lock.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index fcd8d268331..0cc89336199 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -3574,7 +3574,8 @@ lock_table_remove_low( and lock_grant()). Therefore it can be empty and we need to check for that. */ - if (!ib_vector_is_empty(trx->autoinc_locks)) { + if (!lock_get_wait(lock) + && !ib_vector_is_empty(trx->autoinc_locks)) { lock_t* autoinc_lock; autoinc_lock = ib_vector_pop(trx->autoinc_locks); @@ -3647,8 +3648,10 @@ lock_table_enqueue_waiting( if (lock_deadlock_occurs(lock, trx)) { - lock_reset_lock_and_trx_wait(lock); + /* The order here is important, we don't want to + lose the state of the lock before calling remove. */ lock_table_remove_low(lock); + lock_reset_lock_and_trx_wait(lock); return(DB_DEADLOCK); } |