Commit 2cecb5a6 authored by Nikita Malyavin's avatar Nikita Malyavin Committed by Sergei Golubchik

MDEV-31601 Some ALTER TABLEs fail ... with a wrong error message

Report correct algorithm in the error message.
parent 8a165d7c
......@@ -206,3 +206,16 @@ drop table t;
create table t (a int, b int, c char(8), key(a,b,c));
alter table t modify c int auto_increment key, algorithm=copy;
drop table t;
# MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
# a wrong error message
create table t (a int) engine=aria;
insert into t values (1),(2);
alter table t algorithm=nocopy, order by a;
ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=COPY
alter table t engine=myisam, algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
drop table t;
create temporary table t (f int);
alter table t force, algorithm=instant;
ERROR 0A000: ALGORITHM=INSTANT is not supported for this operation. Try ALGORITHM=COPY
drop table t;
......@@ -207,3 +207,18 @@ drop table t;
create table t (a int, b int, c char(8), key(a,b,c));
alter table t modify c int auto_increment key, algorithm=copy;
drop table t;
--echo # MDEV-31601 Some ALTER TABLE .. fail when they worked before, and with
--echo # a wrong error message
create table t (a int) engine=aria;
insert into t values (1),(2);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t algorithm=nocopy, order by a;
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t engine=myisam, algorithm=inplace;
drop table t;
create temporary table t (f int);
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t force, algorithm=instant;
drop table t;
......@@ -14,7 +14,7 @@ a b c
1 2 4
2 3 5
alter online table mysql57_virtual comment "I am now a MariaDB table", algorithm=nocopy;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
ERROR 0A000: ALGORITHM=NOCOPY is not supported for this operation. Try ALGORITHM=COPY
alter table mysql57_virtual comment "I am now a MariaDB table";
SHOW CREATE TABLE mysql57_virtual;
Table Create Table
......
......@@ -10690,7 +10690,7 @@ do_continue:;
if (alter_info->algorithm_is_nocopy(thd))
{
my_error(ER_ALTER_OPERATION_NOT_SUPPORTED, MYF(0),
"ALGORITHM=INPLACE", "ALGORITHM=COPY");
alter_info->algorithm_clause(thd), "ALGORITHM=COPY");
DBUG_RETURN(true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment