Details
-
New Feature
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
With MDEV-16329, the majority of ALTER TABLE operations would be possible while allowing concurrent modifications to the table. Notable exceptions include ADD … AUTO_INCREMENT and DROP PRIMARY KEY without ADD PRIMARY KEY.
It could be convenient to introduce an option that allows ALTER TABLE to behave like ALTER ONLINE TABLE: refuse the operation if it would lock the table. This would be in line with the SET alter_algorithm that was introduced in MDEV-13134: allow table-rebuilding or non-instantaneous ALTER TABLE to be refused unless an explicit ALGORITHM clause is specified by the user.
The proposal is to introduce a parameter with 3 values:
-- the current situation (LOCK=DEFAULT): choose the weakest available of LOCK=SHARED and LOCK=NONE
|
SET alter_lock=DEFAULT; |
-- disable any non-online ALTER (return an error unless explicit LOCK=DEFAULT or LOCK=SHARED is specified)
|
SET alter_lock=NONE; |
-- disable ALTER ONLINE TABLE (lock the table; avoid allocating any logs)
|
SET alter_lock=SHARED; |
There should be no need to implicitly add LOCK=EXCLUSIVE to each ALTER TABLE statement. That locking mode is rather useless.
Attachments
Issue Links
- relates to
-
MDEV-13134 Introduce ALTER TABLE attributes ALGORITHM=NOCOPY and ALGORITHM=INSTANT
- Closed
-
MDEV-16329 Engine-independent online ALTER TABLE
- Closed
-
MDEV-20590 Introduce a file format constraint to ALTER TABLE
- Closed