My suggestion is to use the following condition: ============================= if (!lock_rec_get_insert_intention(lock) && ((!srv_locks_unsafe_for_binlog && (lock->trx->isolation_level > TRX_ISO_READ_COMMITTED)) || (lock->trx->duplicates ? lock_get_mode(lock) == LOCK_X : ((lock->trx->isolation_level > TRX_ISO_READ_COMMITTED) ? lock_get_mode(lock) == LOCK_S : false)))) { lock_rec_add_to_queue( LOCK_REC | LOCK_GAP | lock_get_mode(lock), heir_block, heir_heap_no, lock->index, lock->trx, FALSE); } ======================
instead of the original ======================= if (!lock_rec_get_insert_intention(lock) && !((srv_locks_unsafe_for_binlog || lock->trx->isolation_level <= TRX_ISO_READ_COMMITTED) && lock_get_mode(lock) == (lock->trx->duplicates ? LOCK_S : LOCK_X))) { lock_rec_add_to_queue( LOCK_REC | LOCK_GAP | lock_get_mode(lock), heir_block, heir_heap_no, lock->index, lock->trx, FALSE); } ===========================
in lock_rec_inherit_to_gap(). Testing now.
My suggestion is to use the following condition: ======= ======= ======= = rec_get_ insert_ intention( lock) && locks_unsafe_ for_binlog && >trx->isolation _level > TRX_ISO_ READ_COMMITTED) ) || >trx->duplicate s ? get_mode( lock) == LOCK_X : lock->trx- >isolation_ level > TRX_ISO_ READ_COMMITTED) ?
lock_get_ mode(lock) == LOCK_S : rec_add_ to_queue( mode(lock) , ======= ======= =
=======
if (!lock_
((!srv_
(lock-
(lock-
lock_
((
false)))) {
lock_
LOCK_REC | LOCK_GAP | lock_get_
heir_block, heir_heap_no, lock->index,
lock->trx, FALSE);
}
=======
instead of the original ======= ======= == rec_get_ insert_ intention( lock) locks_unsafe_ for_binlog >isolation_ level READ_COMMITTED) >trx->duplicate s ? LOCK_S : LOCK_X))) { rec_add_ to_queue( mode(lock) , ======= ======= ======
=======
if (!lock_
&& !((srv_
|| lock->trx-
<= TRX_ISO_
&& lock_get_mode(lock) ==
(lock-
lock_
LOCK_REC | LOCK_GAP | lock_get_
heir_block, heir_heap_no, lock->index,
lock->trx, FALSE);
}
=======
in lock_rec_ inherit_ to_gap( ). Testing now.