diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2019-01-30 00:37:11 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-04-03 16:47:27 +0400 |
commit | 914bb5387fa1a0e7324573370fb353ea41bffc0f (patch) | |
tree | 0a5036578e6d6e13af3843aea2b6bfa0121b8dd6 /mysql-test | |
parent | 878f83151f58b8fbf1b6102f32c5bfabbca3c478 (diff) | |
download | mariadb-git-914bb5387fa1a0e7324573370fb353ea41bffc0f.tar.gz |
Removed redundant partitioning check
This check was introduced in 602a222 and then became redundant in ad1553e,
where we attempt to open a table even for non-copy algorithms.
Added missing test case from 602a222.
Part of MDEV-17805 - Remove InnoDB cache for temporary tables.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/partition_innodb.result | 27 | ||||
-rw-r--r-- | mysql-test/main/partition_innodb.test | 19 | ||||
-rw-r--r-- | mysql-test/suite/versioning/r/partition_innodb.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/versioning/t/partition_innodb.test | 1 |
4 files changed, 47 insertions, 2 deletions
diff --git a/mysql-test/main/partition_innodb.result b/mysql-test/main/partition_innodb.result index ed79bbbe48d..605ac38384e 100644 --- a/mysql-test/main/partition_innodb.result +++ b/mysql-test/main/partition_innodb.result @@ -580,6 +580,33 @@ DROP TABLE t1; # Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the # table unusable". # +CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a)) +ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2; +INSERT INTO t1 values (0,1), (1,2); +# The below ALTER should fail. It should leave the +# table in its original, non-corrupted, usable state. +ALTER TABLE t1 ADD UNIQUE KEY (b); +ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function +# The below statements should succeed, as ALTER should +# have left table intact. +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL, + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 + PARTITION BY KEY (`a`) +PARTITIONS 2 +SELECT * FROM t1; +a b +1 2 +0 1 +DROP TABLE t1; +# +# Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the +# table unusable". +# DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a)) ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2; diff --git a/mysql-test/main/partition_innodb.test b/mysql-test/main/partition_innodb.test index e09a2b4f9d3..ae0ce59fabc 100644 --- a/mysql-test/main/partition_innodb.test +++ b/mysql-test/main/partition_innodb.test @@ -665,6 +665,25 @@ OPTIMIZE TABLE t1; SET SESSION sql_mode = @old_mode; DROP TABLE t1; + +--echo # +--echo # Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the +--echo # table unusable". +--echo # +CREATE TABLE t1 (a bigint not null, b int not null, PRIMARY KEY (a)) + ENGINE = InnoDB PARTITION BY KEY(a) PARTITIONS 2; +INSERT INTO t1 values (0,1), (1,2); +--echo # The below ALTER should fail. It should leave the +--echo # table in its original, non-corrupted, usable state. +--error ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF +ALTER TABLE t1 ADD UNIQUE KEY (b); +--echo # The below statements should succeed, as ALTER should +--echo # have left table intact. +SHOW CREATE TABLE t1; +SELECT * FROM t1; +DROP TABLE t1; + + --echo # --echo # Bug#57985 "ONLINE/FAST ALTER PARTITION can fail and leave the --echo # table unusable". diff --git a/mysql-test/suite/versioning/r/partition_innodb.result b/mysql-test/suite/versioning/r/partition_innodb.result index de3521b6aa3..f5945304899 100644 --- a/mysql-test/suite/versioning/r/partition_innodb.result +++ b/mysql-test/suite/versioning/r/partition_innodb.result @@ -20,7 +20,7 @@ alter table t1 partition by system_time ( partition p0 history, partition pn current ); -ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `#sql-temporary` +ERROR HY000: `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1` create or replace table t ( a int primary key, row_start bigint unsigned as row start invisible, diff --git a/mysql-test/suite/versioning/t/partition_innodb.test b/mysql-test/suite/versioning/t/partition_innodb.test index bb4fe50ce91..d7527ff7410 100644 --- a/mysql-test/suite/versioning/t/partition_innodb.test +++ b/mysql-test/suite/versioning/t/partition_innodb.test @@ -21,7 +21,6 @@ create or replace table t1( period for system_time(row_start, row_end) ) engine=InnoDB with system versioning; ---replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ --error ER_VERS_FIELD_WRONG_TYPE alter table t1 partition by system_time ( partition p0 history, |