summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/instant_alter_extend.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/t/instant_alter_extend.test')
-rw-r--r--mysql-test/suite/innodb/t/instant_alter_extend.test103
1 files changed, 71 insertions, 32 deletions
diff --git a/mysql-test/suite/innodb/t/instant_alter_extend.test b/mysql-test/suite/innodb/t/instant_alter_extend.test
index 80f82820afe..6b528c1d30c 100644
--- a/mysql-test/suite/innodb/t/instant_alter_extend.test
+++ b/mysql-test/suite/innodb/t/instant_alter_extend.test
@@ -1,8 +1,10 @@
--source include/have_innodb.inc
+--source include/innodb_row_format.inc
--source include/maybe_debug.inc
-- echo #
-- echo # MDEV-15563: Instant ROW_FORMAT=REDUNDANT column type change&extension
+-- echo # (reverted in MDEV-18627)
-- echo #
# Use character-set-server in test db
@@ -10,8 +12,6 @@ create or replace database test;
use test;
set default_storage_engine=innodb;
-set @save_format= @@GLOBAL.innodb_default_row_format;
-SET GLOBAL innodb_default_row_format=redundant;
set @bigval= repeat('0123456789', 30);
delimiter ~~;
@@ -45,7 +45,9 @@ set @save_debug= @@SESSION.debug_dbug;
set debug_dbug= '+d,ib_instant_error';
--enable_query_log
}
-alter table t modify a char(200), algorithm=instant;
+--enable_info
+alter table t modify a char(200);
+--disable_info
select count(a) from t where a = @bigval;
select a, length(a) from t where a = 'z';
@@ -53,7 +55,9 @@ check table t extended;
call check_table('t');
--echo # CHAR enlargement
-alter table t modify a char(220), algorithm=instant;
+--enable_info
+alter table t modify a char(220);
+--disable_info
select count(a) from t where a = @bigval;
select a, length(a) from t where a = 'z';
@@ -61,10 +65,10 @@ check table t extended;
call check_table('t');
--echo # Convert from VARCHAR to a bigger CHAR
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t modify a varchar(200), algorithm=instant;
-alter table t modify a varchar(200), algorithm=copy;
-alter table t modify a char(255), algorithm=instant;
+--enable_info
+alter table t modify a varchar(200);
+alter table t modify a char(255);
+--disable_info
select count(a) from t where a = @bigval;
select a, length(a) from t where a = 'z';
@@ -74,14 +78,17 @@ call check_table('t');
--echo # BINARY/VARBINARY test
create or replace table t (a varbinary(300));
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t modify a binary(255), algorithm=instant;
-alter table t modify a binary(255), algorithm=copy;
+insert into t values(NULL);
+--enable_info
+alter table t modify a binary(255);
+--disable_info
create or replace table t (a varbinary(200));
insert into t values (@bigval);
insert into t values ('z');
-alter table t modify a binary(200), algorithm=instant;
+--enable_info
+alter table t modify a binary(200);
+--disable_info
select count(a) from t where a = @bigval;
select length(a) from t where left(a, 1) = 'z';
@@ -89,16 +96,18 @@ check table t extended;
call check_table('t');
--echo # BINARY enlargement
-alter table t modify a binary(220), algorithm=instant;
+--enable_info
+alter table t modify a binary(220);
+--disable_info
check table t extended;
call check_table('t');
--echo # Convert from VARBINARY to a bigger BINARY
---error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
-alter table t modify a varbinary(220), algorithm=instant;
-alter table t modify a varbinary(220), algorithm=copy;
-alter table t modify a binary(255), algorithm=instant;
+--enable_info
+alter table t modify a varbinary(220);
+alter table t modify a binary(255);
+--disable_info
select count(a) from t where a = @bigval;
select a, length(a) from t where a = 'z';
@@ -110,25 +119,33 @@ call check_table('t');
--echo # Integer conversions
create or replace table t (x tinyint);
insert into t values (127);
-alter table t modify x smallint, algorithm=instant;
+--enable_info
+alter table t modify x smallint;
+--disable_info
select * from t;
check table t extended;
call check_table('t');
update t set x= 32767;
-alter table t modify x mediumint, algorithm=instant;
+--enable_info
+alter table t modify x mediumint;
+--disable_info
select * from t;
check table t extended;
call check_table('t');
update t set x= 8388607;
-alter table t modify x int, algorithm=instant;
+--enable_info
+alter table t modify x int;
+--disable_info
select * from t;
check table t extended;
call check_table('t');
update t set x= 2147483647;
-alter table t modify x bigint, algorithm=instant;
+--enable_info
+alter table t modify x bigint;
+--disable_info
select * from t;
check table t extended;
call check_table('t');
@@ -163,13 +180,19 @@ call check_table('t2');
create or replace table t1 (x mediumint);
insert into t1 values (1);
insert into t1 values (1);
-alter table t1 add column y int first, modify x int, algorithm instant;
+--enable_info
+alter table t1 add column y int first, modify x int;
--error ER_DUP_ENTRY
alter table t1 add column z int first, add primary key (x);
+--disable_info
--echo # Check assertion in wrong instant operation
create or replace table t1 (a varchar(26) not null) default character set utf8mb4;
-alter table t1 modify a varchar(25) not null;
+insert into t1 values ('abcdef'), (repeat('x',26));
+--enable_info
+alter ignore table t1 modify a varchar(25) not null;
+--disable_info
+select * from t1;
--echo # Check row_mysql_store_col_in_innobase_format()
create or replace table t1(x int primary key, a varchar(20));
@@ -181,30 +204,46 @@ update t1 set a= 'foo' where x = 2;
--echo #
create or replace table t1 (x int, y int);
insert into t1 (x, y) values (11, 22);
-alter table t1 modify x bigint, algorithm instant;
-alter table t1 add primary key (x), algorithm inplace;
+--enable_info
+alter table t1 modify x bigint;
+alter table t1 add primary key (x);
+--disable_info
+select * from t1;
check table t1;
create or replace table t1 (a varchar(10), y int);
insert into t1 (a, y) values ("0123456789", 33);
-alter table t1 modify a char(15), algorithm instant;
-alter table t1 add primary key (a), algorithm inplace;
+--enable_info
+alter table t1 modify a char(15);
+alter table t1 add primary key (a);
+--disable_info
+select * from t1;
check table t1;
create or replace table t1 (x int primary key, y int);
insert into t1 (x, y) values (44, 55);
-alter table t1 modify x bigint, algorithm inplace;
+--enable_info
+alter table t1 modify x bigint;
+--disable_info
+select * from t1;
check table t1;
create or replace table t1 (x int primary key, y int);
insert into t1 values (66, 77);
-alter table t1 add column z int, algorithm instant;
-alter table t1 drop column y, algorithm instant;
+--enable_info
+alter table t1 add column z int;
+alter table t1 drop column y;
+--disable_info
+select * from t1;
+check table t1;
create or replace table t1 (x integer, a varchar(20));
-alter table t1 add index idx3 (a);
+--enable_info
insert into t1 (x, a) values (73, 'a');
+alter table t1 add index idx3 (a);
alter table t1 modify a char(20);
+--disable_info
+select * from t1;
+check table t1;
create or replace database test charset latin1;
-SET GLOBAL innodb_default_row_format=@save_format;