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/xtradb | |
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/xtradb')
-rw-r--r-- | storage/xtradb/lock/lock0lock.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/storage/xtradb/lock/lock0lock.cc b/storage/xtradb/lock/lock0lock.cc index 341c452cd15..29f89dcbf4f 100644 --- a/storage/xtradb/lock/lock0lock.cc +++ b/storage/xtradb/lock/lock0lock.cc @@ -887,10 +887,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(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(lock->trx->lock.wait_lock->trx->mysql_thd, &stmt_len); + } + + ib_logf(IB_LOG_LEVEL_INFO, + "Trx id %lu is waiting a lock in statement %s" + " for this trx id %lu and statement %s wait_lock %p", + lock->trx->id, + stmt ? stmt : "NULL", + trx_id, + stmt2 ? stmt2 : "NULL", + lock->trx->lock.wait_lock); + ut_error; + } + lock->trx->lock.wait_lock = NULL; lock->type_mode &= ~LOCK_WAIT; } |