Details
-
Bug
-
Status: Stalled (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL)
-
None
Description
ALTER TABLE with explicit unsupported algorithm is still executed when alter_algorithm variable is set to COPY. Apparently, the explicit algorithm is quietly ignored.
10.4 99ee200b |
MariaDB [test]> create table t1 (a int); |
Query OK, 0 rows affected (0.039 sec) |
|
MariaDB [test]> alter table t1 force, algorithm=instant; |
ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
MariaDB [test]> set alter_algorithm= copy; |
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> alter table t1 force, algorithm=instant; |
Query OK, 0 rows affected (0.123 sec) |
Records: 0 Duplicates: 0 Warnings: 0
|
It contradicts the variable documentation, as well as common sense.
Noticeably, it's not the universal rule "variable takes precedence over the clause", apparently it is specific to the COPY algorithm. It doesn't happen with alter_algorithm=INPLACE which is also supported for the operation:
MariaDB [test]> set alter_algorithm= inplace; |
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> alter table t1 force, algorithm=instant; |
ERROR 1845 (0A000): ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=INPLACE |
Even if was at some point intentional (maybe some legacy reasons), I think it should be made uniform and consistent. I'm not sure however that it can be done post-GA, so I'm setting fix version to the next RC. Please adjust if needed.
MTR |
create table t1 (a int); |
|
set alter_algorithm= DEFAULT; |
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
alter table t1 force, algorithm=instant; |
|
set alter_algorithm= INPLACE; |
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
alter table t1 force, algorithm=instant; |
|
set alter_algorithm= COPY; |
|
--error ER_ALTER_OPERATION_NOT_SUPPORTED
|
alter table t1 force, algorithm=instant; |
|
# Cleanup
|
drop table t1; |
mysqltest: At line 16: query 'alter table t1 force, algorithm=instant' succeeded - should have failed with errno 1845... |
Attachments
Issue Links
- relates to
-
MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with a wrong error message
- Closed
-
MDEV-30984 Online ALTER table is denied with non-informative error messages
- Closed