mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-13115: Implement SELECT SKIP LOCKED
Adds an implementation for SELECT ... FOR UPDATE SKIP LOCKED /
SELECT ... LOCK IN SHARED MODE SKIP LOCKED
This is implemented only InnoDB at the moment, not in RockDB yet.
This adds a new hander flag HA_CAN_SKIP_LOCKED than
will be used when the storage engine advertises the flag.
When a storage engine indicates this flag it will get
TL_WRITE_SKIP_LOCKED and TL_READ_SKIP_LOCKED transaction types.
The Lex structure has been updated to store both the FOR UPDATE/LOCK IN
SHARE as well as the SKIP LOCKED so the SHOW CREATE VIEW
implementation is simplier.
"SELECT FOR UPDATE ... SKIP LOCKED" combined with CREATE TABLE AS or
INSERT.. SELECT on the result set is not safe for STATEMENT based
replication. MIXED replication will replicate this as row based events."
Thanks to guidance from Facebook commit
193896c466
This helped verify basic test case, and components that need implementing
(even though every part was implemented differently).
Thanks Marko for guidance on simplier InnoDB implementation.
Reviewers: Marko, Monty
This commit is contained in:
@ -49,11 +49,13 @@ static const char *lock_descriptions[] =
|
||||
/* TL_READ_WITH_SHARED_LOCKS */ "Shared read lock",
|
||||
/* TL_READ_HIGH_PRIORITY */ "High priority read lock",
|
||||
/* TL_READ_NO_INSERT */ "Read lock without concurrent inserts",
|
||||
/* TL_READ_SKIP_LOCKED */ "Read lock without blocking if row is locked",
|
||||
/* TL_WRITE_ALLOW_WRITE */ "Write lock that allows other writers",
|
||||
/* TL_WRITE_CONCURRENT_INSERT */ "Concurrent insert lock",
|
||||
/* TL_WRITE_DELAYED */ "Lock used by delayed insert",
|
||||
/* TL_WRITE_DEFAULT */ NULL,
|
||||
/* TL_WRITE_LOW_PRIORITY */ "Low priority write lock",
|
||||
/* TL_WRITE_SKIP_LOCKED */ "Write lock but skip existing locked rows",
|
||||
/* TL_WRITE */ "High priority write lock",
|
||||
/* TL_WRITE_ONLY */ "Highest priority write lock"
|
||||
};
|
||||
|
Reference in New Issue
Block a user