diff options
Diffstat (limited to 'storage/innobase/lock/lock0lock.c')
-rw-r--r-- | storage/innobase/lock/lock0lock.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/storage/innobase/lock/lock0lock.c b/storage/innobase/lock/lock0lock.c index 6e762f65679..c500bf44ffa 100644 --- a/storage/innobase/lock/lock0lock.c +++ b/storage/innobase/lock/lock0lock.c @@ -1742,7 +1742,7 @@ lock_t* lock_rec_create( /*============*/ #ifdef WITH_WSREP - lock_t* c_lock, /* conflicting lock */ + lock_t* c_lock, /* conflicting lock */ #endif ulint type_mode,/*!< in: lock mode and wait flag, type is ignored and @@ -1810,7 +1810,7 @@ lock_rec_create( #ifdef WITH_WSREP if (c_lock && wsrep_thd_is_brute_force(trx->mysql_thd)) { - lock_t *hash = c_lock->hash; + lock_t *hash = c_lock->hash; lock_t *prev = NULL; while (hash && @@ -1829,7 +1829,7 @@ lock_rec_create( * delayed conflict resolution '...kill_one_trx' was not called, * if victim was waiting for some other lock */ - if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) { + if (c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) { c_lock->trx->was_chosen_as_deadlock_victim = TRUE; if (wsrep_debug && c_lock->trx->wait_lock != c_lock) { @@ -1851,8 +1851,8 @@ lock_rec_create( } if (wsrep_debug) fprintf( - stderr, - "WSREP: c_lock canceled %llu\n", + stderr, + "WSREP: c_lock canceled %llu\n", (ulonglong) c_lock->trx->id); /* have to bail out here to avoid lock_set_lock... */ @@ -1865,7 +1865,7 @@ lock_rec_create( #else HASH_INSERT(lock_t, hash, lock_sys->rec_hash, lock_rec_fold(space, page_no), lock); -#endif +#endif /* WITH_WSREP */ if (lock_is_wait_not_by_other(type_mode)) { lock_set_lock_and_trx_wait(lock, trx); @@ -1886,7 +1886,7 @@ enum db_err lock_rec_enqueue_waiting( /*=====================*/ #ifdef WITH_WSREP - lock_t* c_lock, /* conflicting lock */ + lock_t* c_lock, /* conflicting lock */ #endif ulint type_mode,/*!< in: lock mode this transaction is requesting: @@ -2231,7 +2231,7 @@ lock_rec_lock_slow( { trx_t* trx; #ifdef WITH_WSREP - lock_t *c_lock= 0; + lock_t* c_lock = NULL; #endif lock_t* lock; @@ -2281,10 +2281,10 @@ lock_rec_lock_slow( #ifdef WITH_WSREP } else if ((c_lock = lock_rec_other_has_conflicting( - mode, block, heap_no, trx))) { + mode, block, heap_no, trx))) { #else } else if (lock_rec_other_has_conflicting(mode, block, heap_no, trx)) { -#endif +#endif /* WITH_WSREP */ /* If another transaction has a non-gap conflicting request in the queue, as this transaction does not have a lock strong @@ -2293,12 +2293,15 @@ lock_rec_lock_slow( ut_ad(lock == NULL); enqueue_waiting: #ifdef WITH_WSREP - return(lock_rec_enqueue_waiting(c_lock,mode, block, heap_no, + /* c_lock is NULL here if jump to enqueue_waiting happened + but it's ok because lock is not NULL in that case and c_lock + is not used. */ + return(lock_rec_enqueue_waiting(c_lock, mode, block, heap_no, lock, index, thr)); #else return(lock_rec_enqueue_waiting(mode, block, heap_no, lock, index, thr)); -#endif +#endif /* WITH_WSREP */ } else if (!impl) { /* Set the requested lock on the record */ @@ -3961,7 +3964,8 @@ lock_table_create( if (c_lock && c_lock->trx->que_state == TRX_QUE_LOCK_WAIT) { if (wsrep_debug) { - fprintf(stderr, "WSREP: table c_lock in wait: %llu new loc: %llu\n", + fprintf(stderr, + "WSREP: table c_lock in wait: %llu new loc: %llu\n", (ulonglong) c_lock->trx->id, lock->trx->id); } @@ -5603,7 +5607,7 @@ lock_rec_insert_check_and_lock( | LOCK_INSERT_INTENTION, block, next_rec_heap_no, NULL, index, thr); -#endif +#endif /* WITH_WSREP */ } else { err = DB_SUCCESS; } |