diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-21 13:59:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-21 13:59:04 +0200 |
commit | 9fdb8c59eb297c6acb15345ae732678d0d8ee838 (patch) | |
tree | 5e09a6bc5437e35331ac104d15217e1e95a555ed /mysql-test/suite | |
parent | 1ee0144db7a38bf1cb768505b606fb407f097110 (diff) | |
download | mariadb-git-9fdb8c59eb297c6acb15345ae732678d0d8ee838.tar.gz |
MDEV-17721: Corrupted data dictionary after instant DROP COLUMN
dict_index_t::clear_instant_alter(): Remove a loop that became
redundant in commit ae2004c616e2955a7978a0e7b876836ef9d8ee33
and caused corruption of n_nullable when dropping the last column
which was not declared NOT NULL.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter.result | 17 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/instant_alter.test | 6 |
2 files changed, 22 insertions, 1 deletions
diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result index 902acf7c1ea..40681c5a439 100644 --- a/mysql-test/suite/innodb/r/instant_alter.result +++ b/mysql-test/suite/innodb/r/instant_alter.result @@ -553,6 +553,11 @@ ALTER TABLE t1 DROP f1, DROP f2, ADD f4 INT, ADD f5 INT; DELETE FROM t1; ALTER TABLE t1 DROP COLUMN f4; DROP TABLE t1; +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +ALTER TABLE t1 DROP f2, ADD COLUMN f4 INT; +ALTER TABLE t1 DROP f4; +ALTER TABLE t1 DROP f1; +DROP TABLE t1; CREATE TABLE t1 (id INT PRIMARY KEY, c2 INT UNIQUE, c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'), @@ -1052,6 +1057,11 @@ ALTER TABLE t1 DROP f1, DROP f2, ADD f4 INT, ADD f5 INT; DELETE FROM t1; ALTER TABLE t1 DROP COLUMN f4; DROP TABLE t1; +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) ENGINE=InnoDB ROW_FORMAT=COMPACT; +ALTER TABLE t1 DROP f2, ADD COLUMN f4 INT; +ALTER TABLE t1 DROP f4; +ALTER TABLE t1 DROP f1; +DROP TABLE t1; CREATE TABLE t1 (id INT PRIMARY KEY, c2 INT UNIQUE, c3 POINT NOT NULL DEFAULT ST_GeomFromText('POINT(3 4)'), @@ -1551,10 +1561,15 @@ ALTER TABLE t1 DROP f1, DROP f2, ADD f4 INT, ADD f5 INT; DELETE FROM t1; ALTER TABLE t1 DROP COLUMN f4; DROP TABLE t1; +CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +ALTER TABLE t1 DROP f2, ADD COLUMN f4 INT; +ALTER TABLE t1 DROP f4; +ALTER TABLE t1 DROP f1; +DROP TABLE t1; disconnect analyze; SELECT variable_value-@old_instant instants FROM information_schema.global_status WHERE variable_name = 'innodb_instant_alter_column'; instants -102 +111 SET GLOBAL innodb_purge_rseg_truncate_frequency= @saved_frequency; diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index e642e3a6057..38f6bf7a046 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -431,6 +431,12 @@ DELETE FROM t1; ALTER TABLE t1 DROP COLUMN f4; DROP TABLE t1; +eval CREATE TABLE t1 (f1 INT, f2 INT, f3 INT) $engine; +ALTER TABLE t1 DROP f2, ADD COLUMN f4 INT; +ALTER TABLE t1 DROP f4; +ALTER TABLE t1 DROP f1; +DROP TABLE t1; + dec $format; } disconnect analyze; |