Commit b81a403e authored by Marko Mäkelä's avatar Marko Mäkelä Committed by Sergei Golubchik

lock_rec_enqueue_waiting(): Fix diagnostics

This is fixup after commit 8026cd62.
We must not silently allow a lock wait to occur during InnoDB data
dictionary transactions. The dict_operation_lock is supposed to
prevent lock waits, and we want to be aware of any errors.
parent 1924594b
......@@ -1719,11 +1719,6 @@ lock_rec_enqueue_waiting(
trx_t* trx = thr_get_trx(thr);
if (trx->mysql_thd && thd_lock_wait_timeout(trx->mysql_thd) == 0) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
return DB_LOCK_WAIT_TIMEOUT;
}
ut_ad(trx_mutex_own(trx));
ut_a(!que_thr_stop(thr));
......@@ -1741,6 +1736,11 @@ lock_rec_enqueue_waiting(
ut_ad(0);
}
if (trx->mysql_thd && thd_lock_wait_timeout(trx->mysql_thd) == 0) {
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
return DB_LOCK_WAIT_TIMEOUT;
}
/* Enqueue the lock request that will wait to be granted, note that
we already own the trx mutex. */
lock_t* lock = lock_rec_create(
......
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