Commit 8e5f532d authored by Jan Lindström's avatar Jan Lindström

MDEV-10692: InnoDB: Failing assertion: lock->trx->lock.wait_lock == lock

This is not a fix, this is instrumentation to find the bug.
parent 0259b3cb
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment