summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/t/partition_double_myisam.test
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2022-12-13 16:06:13 +0300
committerVlad Lesin <vlad_lesin@mail.ru>2022-12-20 11:31:49 +0300
commit3ddc00dc3bf29f7cf326268265e47fda61e6a83e (patch)
tree14f8ab5c47fa6d84735ec2f79ca205044be94470 /mysql-test/suite/parts/t/partition_double_myisam.test
parent3f63aa18a7f81540049c8414308c6c04fdc4a5ad (diff)
downloadmariadb-git-3ddc00dc3bf29f7cf326268265e47fda61e6a83e.tar.gz
MDEV-30225 RR isolation violation with locking unique search
Before the fix next-key lock was requested only if a record was delete-marked for locking unique search in RR isolation level. There can be several delete-marked records for the same unique key, that's why InnoDB scans the records until eighter non-delete-marked record is reached or all delete-marked records with the same unique key are scanned. For range scan next-key locks are used for RR to protect scanned range from inserting new records by other transactions. And this is the reason of why next-key locks are used for delete-marked records for unique searches. If a record is not delete-marked, the requested lock type was "not-gap". When a record is not delete-marked during lock request by trx 1, and some other transaction holds conflicting lock, trx 1 creates waiting not-gap lock on the record and suspends. During trx 1 suspending the record can be delete-marked. And when the lock is granted on conflicting transaction commit or rollback, its type is still "not-gap". So we have "not-gap" lock on delete-marked record for RR. And this let some other transaction to insert some record with the same unique key when trx 1 is not committed, what can cause isolation level violation. The fix is to set next-key locks for both delete-marked and non-delete-marked records for unique search in RR.
Diffstat (limited to 'mysql-test/suite/parts/t/partition_double_myisam.test')
0 files changed, 0 insertions, 0 deletions