1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

fix for alter_table_online test.

Map ALTER ONLINE TABLE to ALTER TABLE ... ALGORITHM=INPLACE.
Make MERGE engine to announce its support of inplace operations.
This commit is contained in:
Sergei Golubchik
2013-07-10 12:48:56 +02:00
parent 7ac5a1d362
commit 0ce9391008
6 changed files with 82 additions and 81 deletions

View File

@ -11,61 +11,59 @@ drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 modify b int default 5;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 change b new_name int;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify e enum('a','b','c');
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 comment "new comment";
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 rename to t2;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify b bigint;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify e enum('c','a','b');
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(50);
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(100);
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 add f int;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 engine=memory;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
ERROR HY000: Can't execute the given 'ALTER' command as online
alter online table t1 drop index b;
ERROR HY000: Can't execute the given 'ALTER' command as online
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
alter online table t1 drop column b, add b int;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify b bigint;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify e enum('c','a','b');
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(50);
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 modify c varchar(100);
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 add f int;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 engine=memory;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter table t1 engine=innodb;
alter table t1 add index (b);
alter online table t1 add index c (c);
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
alter online table t1 drop index b;
ERROR HY000: Can't execute the given 'ALTER' command as online
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80));
create table t2 (a int not null primary key, b int, c varchar(80));

View File

@ -1,5 +1,5 @@
#
# Test of alter online table
# Test of ALTER ONLINE TABLE syntax
#
--source include/have_innodb.inc
@ -29,15 +29,15 @@ drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify b int default 5;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 change b new_name int;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify e enum('a','b','c');
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 comment "new comment";
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 rename to t2;
drop table t1;
@ -49,52 +49,50 @@ drop table t1;
create table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 drop column b, add b int;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify b bigint;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify e enum('c','a','b');
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(50);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(100);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 add f int;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 engine=memory;
alter table t1 engine=innodb;
alter table t1 add index (b);
--error ER_CANT_DO_ONLINE
alter online table t1 add index c (c);
--error ER_CANT_DO_ONLINE
alter online table t1 drop index b;
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 drop column b, add b int;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify b bigint;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify e enum('c','a','b');
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(50);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 modify c varchar(100);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 add f int;
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 engine=memory;
alter table t1 engine=innodb;
alter table t1 add index (b);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 add index c (c);
--error ER_CANT_DO_ONLINE
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t1 drop index b;
drop table t1;