Skip to content

Commit b81a403

Browse files
dr-mvuvova
authored andcommitted
lock_rec_enqueue_waiting(): Fix diagnostics
This is fixup after commit 8026cd6. 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.
1 parent 1924594 commit b81a403

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

storage/innobase/lock/lock0lock.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,11 +1719,6 @@ lock_rec_enqueue_waiting(
17191719

17201720
trx_t* trx = thr_get_trx(thr);
17211721

1722-
if (trx->mysql_thd && thd_lock_wait_timeout(trx->mysql_thd) == 0) {
1723-
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
1724-
return DB_LOCK_WAIT_TIMEOUT;
1725-
}
1726-
17271722
ut_ad(trx_mutex_own(trx));
17281723
ut_a(!que_thr_stop(thr));
17291724

@@ -1741,6 +1736,11 @@ lock_rec_enqueue_waiting(
17411736
ut_ad(0);
17421737
}
17431738

1739+
if (trx->mysql_thd && thd_lock_wait_timeout(trx->mysql_thd) == 0) {
1740+
trx->error_state = DB_LOCK_WAIT_TIMEOUT;
1741+
return DB_LOCK_WAIT_TIMEOUT;
1742+
}
1743+
17441744
/* Enqueue the lock request that will wait to be granted, note that
17451745
we already own the trx mutex. */
17461746
lock_t* lock = lock_rec_create(

0 commit comments

Comments
 (0)