diff options
Diffstat (limited to 'mysql-test')
6 files changed, 66 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff new file mode 100644 index 00000000000..5e46c66ce73 --- /dev/null +++ b/mysql-test/suite/innodb/r/instant_alter_limit,32k.rdiff @@ -0,0 +1,9 @@ +--- instant_alter_limit.result ++++ instant_alter_limit.result +@@ -42,5 +42,5 @@ + FROM information_schema.global_status + WHERE variable_name = 'innodb_instant_alter_column'; + instants +-502 ++506 + DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff new file mode 100644 index 00000000000..795116ffae4 --- /dev/null +++ b/mysql-test/suite/innodb/r/instant_alter_limit,4k.rdiff @@ -0,0 +1,9 @@ +--- instant_alter_limit.result ++++ instant_alter_limit.result +@@ -42,5 +42,5 @@ + FROM information_schema.global_status + WHERE variable_name = 'innodb_instant_alter_column'; + instants +-502 ++474 + DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff new file mode 100644 index 00000000000..5e46c66ce73 --- /dev/null +++ b/mysql-test/suite/innodb/r/instant_alter_limit,64k.rdiff @@ -0,0 +1,9 @@ +--- instant_alter_limit.result ++++ instant_alter_limit.result +@@ -42,5 +42,5 @@ + FROM information_schema.global_status + WHERE variable_name = 'innodb_instant_alter_column'; + instants +-502 ++506 + DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff b/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff new file mode 100644 index 00000000000..37d2ae67c4e --- /dev/null +++ b/mysql-test/suite/innodb/r/instant_alter_limit,8k.rdiff @@ -0,0 +1,9 @@ +--- instant_alter_limit.result ++++ instant_alter_limit.result +@@ -42,5 +42,5 @@ + FROM information_schema.global_status + WHERE variable_name = 'innodb_instant_alter_column'; + instants +-502 ++492 + DROP TABLE t; diff --git a/mysql-test/suite/innodb/r/instant_alter_limit.result b/mysql-test/suite/innodb/r/instant_alter_limit.result index e66579e4a94..e169c40d462 100644 --- a/mysql-test/suite/innodb/r/instant_alter_limit.result +++ b/mysql-test/suite/innodb/r/instant_alter_limit.result @@ -32,4 +32,15 @@ instants SELECT * FROM t; a b 1 0 +ALTER TABLE t ADD COLUMN (c CHAR(255) NOT NULL, d BIGINT NOT NULL), +ALGORITHM=INSTANT; +UPDATE t SET b=b+1,d=d+1,c='foo'; +SELECT * FROM t; +a b c d +1 1 foo 1 +SELECT variable_value-@old_instant instants +FROM information_schema.global_status +WHERE variable_name = 'innodb_instant_alter_column'; +instants +502 DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/instant_alter_limit.test b/mysql-test/suite/innodb/t/instant_alter_limit.test index ded14eee89b..b50a1b15295 100644 --- a/mysql-test/suite/innodb/t/instant_alter_limit.test +++ b/mysql-test/suite/innodb/t/instant_alter_limit.test @@ -1,4 +1,4 @@ ---source include/have_innodb.inc +--source include/innodb_page_size.inc SET @old_instant= (SELECT variable_value FROM information_schema.global_status @@ -38,5 +38,23 @@ FROM information_schema.global_status WHERE variable_name = 'innodb_instant_alter_column'; SELECT * FROM t; +ALTER TABLE t ADD COLUMN (c CHAR(255) NOT NULL, d BIGINT NOT NULL), +ALGORITHM=INSTANT; + +--disable_query_log +let $n=253; +while ($n) { +dec $n; +ALTER TABLE t DROP b, DROP c, DROP d, +ADD COLUMN (b INT NOT NULL, c CHAR(255) NOT NULL, d BIGINT NOT NULL); +} +--enable_query_log + +UPDATE t SET b=b+1,d=d+1,c='foo'; +SELECT * FROM t; + +SELECT variable_value-@old_instant instants +FROM information_schema.global_status +WHERE variable_name = 'innodb_instant_alter_column'; DROP TABLE t; |