diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-11-09 13:32:43 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2016-11-09 13:32:43 +0200 |
commit | 8e5f532dc2cb5922ee59fd6c9a33e9d1614b7b05 (patch) | |
tree | 78ec4adb6654f94f2ff928d096a49f64faa6a1ae /storage/innobase/lock/lock0lock.cc | |
parent | 0259b3cbbe47448beb385a33348af56300004aa6 (diff) | |
download | mariadb-git-8e5f532dc2cb5922ee59fd6c9a33e9d1614b7b05.tar.gz |
MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock
This is not a fix, this is instrumentation to find the bug.
Diffstat (limited to 'storage/innobase/lock/lock0lock.cc')
-rw-r--r-- | storage/innobase/lock/lock0lock.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc index 56d17e4fe1f..d17cef18f76 100644 --- a/storage/innobase/lock/lock0lock.cc +++ b/storage/innobase/lock/lock0lock.cc @@ -776,10 +776,33 @@ lock_reset_lock_and_trx_wait( /*=========================*/ lock_t* lock) /*!< in/out: record lock */ { - ut_ad(lock->trx->lock.wait_lock == lock); ut_ad(lock_get_wait(lock)); ut_ad(lock_mutex_own()); + if (lock->trx->lock.wait_lock != lock) { + const char* stmt=NULL; + const char* stmt2=NULL; + size_t stmt_len; + trx_id_t trx_id = 0; + stmt = innobase_get_stmt_unsafe(lock->trx->mysql_thd, &stmt_len); + + if (lock->trx->lock.wait_lock && + lock->trx->lock.wait_lock->trx) { + trx_id = lock->trx->lock.wait_lock->trx->id; + stmt2 = innobase_get_stmt_unsafe(lock->trx->lock.wait_lock->trx->mysql_thd, &stmt_len); + } + + ib::info() << + "Trx id " << lock->trx->id + << " is waiting a lock in statement " + << (stmt ? stmt : "NULL") + << " for this trx id " << trx_id + << " and statement " + << (stmt2 ? stmt2 : "NULL") + << "wait_lock " << lock->trx->lock.wait_lock; + ut_error; + } + lock->trx->lock.wait_lock = NULL; lock->type_mode &= ~LOCK_WAIT; } |