Commit b2274cb5 authored by marko's avatar marko

branches/zip: lock_rec_add_to_queue(): Improve the debug diagnostics.

Make it easier to display the violating lock request in a debugger.
parent 7b538bb8
...@@ -1836,16 +1836,27 @@ lock_rec_add_to_queue( ...@@ -1836,16 +1836,27 @@ lock_rec_add_to_queue(
lock_t* lock; lock_t* lock;
ut_ad(mutex_own(&kernel_mutex)); ut_ad(mutex_own(&kernel_mutex));
ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP)) #ifdef UNIV_DEBUG
|| ((type_mode & LOCK_MODE_MASK) != LOCK_S) switch (type_mode & LOCK_MODE_MASK) {
|| !lock_rec_other_has_expl_req(LOCK_X, 0, LOCK_WAIT, case LOCK_X:
block, heap_no, trx)); case LOCK_S:
ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP)) break;
|| ((type_mode & LOCK_MODE_MASK) != LOCK_X) default:
|| !lock_rec_other_has_expl_req(LOCK_S, 0, LOCK_WAIT, ut_error;
block, heap_no, trx)); }
type_mode = type_mode | LOCK_REC; if (!(type_mode & (LOCK_WAIT | LOCK_GAP))) {
enum lock_mode mode = (type_mode & LOCK_MODE_MASK) == LOCK_S
? LOCK_X
: LOCK_S;
lock_t* other_lock
= lock_rec_other_has_expl_req(mode, 0, LOCK_WAIT,
block, heap_no, trx);
ut_a(!other_lock);
}
#endif /* UNIV_DEBUG */
type_mode |= LOCK_REC;
/* If rec is the supremum record, then we can reset the gap bit, as /* If rec is the supremum record, then we can reset the gap bit, as
all locks on the supremum are automatically of the gap type, and we all locks on the supremum are automatically of the gap type, and we
......
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