summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-20 12:51:57 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-12-20 12:51:57 +0200
commit042f763268c0f209e7c12e0a6a72bb5d204dfe29 (patch)
tree7ee15ab50af97cab4135f3712f95ac12fafc74c5 /mysql-test/suite/parts
parentcb121a047b55403fe271570c928fd95ed64a1c8f (diff)
parent924db8b4ed3f268cbe91a1734611f4dc2311c7be (diff)
downloadmariadb-git-042f763268c0f209e7c12e0a6a72bb5d204dfe29.tar.gz
Merge remote-tracking branch '5.5' into 10.0
Diffstat (limited to 'mysql-test/suite/parts')
-rw-r--r--mysql-test/suite/parts/inc/part_alter_values.inc37
-rw-r--r--mysql-test/suite/parts/r/partition_alter_innodb.result49
-rw-r--r--mysql-test/suite/parts/r/partition_alter_maria.result44
-rw-r--r--mysql-test/suite/parts/r/partition_alter_myisam.result44
-rw-r--r--mysql-test/suite/parts/t/partition_alter_innodb.test4
-rw-r--r--mysql-test/suite/parts/t/partition_alter_maria.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter_myisam.test18
7 files changed, 178 insertions, 21 deletions
diff --git a/mysql-test/suite/parts/inc/part_alter_values.inc b/mysql-test/suite/parts/inc/part_alter_values.inc
new file mode 100644
index 00000000000..0d4929d9820
--- /dev/null
+++ b/mysql-test/suite/parts/inc/part_alter_values.inc
@@ -0,0 +1,37 @@
+--echo #
+--echo # MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+--echo #
+
+--eval CREATE TABLE t1 (i INT) ENGINE=$engine PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-13788 Server crash when issuing bad SQL partition syntax
+--echo #
+
+--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE))
+SHOW CREATE TABLE t1;
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+ PARTITION p2, /* Notice no values */
+ PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+DROP TABLE t1;
+
+
+--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3))
+SHOW CREATE TABLE t1;
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+ PARTITION p2, /* Notice no values */
+ PARTITION p3 VALUES IN (4,5,6)
+);
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_innodb.result b/mysql-test/suite/parts/r/partition_alter_innodb.result
new file mode 100644
index 00000000000..29076a3c178
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter_innodb.result
@@ -0,0 +1,49 @@
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+Warnings:
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
+Warning 1478 InnoDB: assuming ROW_FORMAT=COMPACT.
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+i
+DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE COLUMNS(d)
+(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p1 VALUES IN (1,2,3) ENGINE = InnoDB) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_maria.result b/mysql-test/suite/parts/r/partition_alter_maria.result
index 6343566e408..fd09c0bd4bb 100644
--- a/mysql-test/suite/parts/r/partition_alter_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter_maria.result
@@ -16,3 +16,47 @@ select * from t1;
pk dt
1 2017-09-28 15:12:00
drop table t1;
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=Aria PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+i
+DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE COLUMNS(d)
+(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = Aria) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p1 VALUES IN (1,2,3) ENGINE = Aria) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result
index 514593fd4ef..9f2381039d3 100644
--- a/mysql-test/suite/parts/r/partition_alter_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter_myisam.result
@@ -1,10 +1,44 @@
-CREATE TABLE t1 (i INT) ENGINE=MYISAM
-PARTITION BY LIST(i) (
-PARTITION p0 VALUES IN (1),
-PARTITION p1 VALUES IN (2)
-);
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=MyISAM PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50500 PARTITION BY RANGE COLUMNS(d)
+(PARTITION p1 VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+/*!50100 PARTITION BY LIST (id)
+(PARTITION p1 VALUES IN (1,2,3) ENGINE = MyISAM) */
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/partition_alter_innodb.test b/mysql-test/suite/parts/t/partition_alter_innodb.test
new file mode 100644
index 00000000000..451bec05adc
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_alter_innodb.test
@@ -0,0 +1,4 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+--let $engine=InnoDB
+--source inc/part_alter_values.inc
diff --git a/mysql-test/suite/parts/t/partition_alter_maria.test b/mysql-test/suite/parts/t/partition_alter_maria.test
index db249591158..e21f0dfab82 100644
--- a/mysql-test/suite/parts/t/partition_alter_maria.test
+++ b/mysql-test/suite/parts/t/partition_alter_maria.test
@@ -16,3 +16,6 @@ select * from t1;
alter table t1 drop partition p20181231;
select * from t1;
drop table t1;
+
+--let $engine=Aria
+--source inc/part_alter_values.inc
diff --git a/mysql-test/suite/parts/t/partition_alter_myisam.test b/mysql-test/suite/parts/t/partition_alter_myisam.test
index 91ce8d21327..a53fa333abd 100644
--- a/mysql-test/suite/parts/t/partition_alter_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter_myisam.test
@@ -1,17 +1,3 @@
-#
-# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
-#
-
--source include/have_partition.inc
-
-CREATE TABLE t1 (i INT) ENGINE=MYISAM
-PARTITION BY LIST(i) (
- PARTITION p0 VALUES IN (1),
- PARTITION p1 VALUES IN (2)
-);
-ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
-ALTER TABLE t1 DROP PARTITION p1;
-SELECT * FROM t1;
-
-# Cleanup
-DROP TABLE t1;
+--let $engine=MyISAM
+--source inc/part_alter_values.inc