Comment 14 for bug 1735555

Revision history for this message
Vlad Lesin (vlad-lesin) wrote :

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.