• Marko Mäkelä's avatar
    MDEV-24224 Gap lock on delete in 10.5 using READ COMMITTED · 33d41167
    Marko Mäkelä authored
    When MDEV-19544 (commit 1a6f4704)
    simplified the initialization of the local variable
    set_also_gap_locks, an inadvertent change was included.
    Essentially, all code branches that are executed when
    set_also_gap_locks hold must also ensure that
    trx->isolation_level > TRX_ISO_READ_COMMITTED holds.
    This was being violated in a few code paths.
    
    It turns out that there is an even simpler fix: Remove the test
    of thd_is_select() completely. In that way, the first part of
    UPDATE or DELETE should work exactly like SELECT...FOR UPDATE.
    
    thd_is_select(): Remove.
    33d41167
gap_locks.result 1.01 KB