summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 11:33:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-21 11:33:59 +0300
commit394784095eeedb3a2915249fe14a9d2e1f91a23a (patch)
tree0a2e7ad98bfa382744d87c6af6eb91f4bfc3858d /mysql-test/suite/parts
parentd7189fbcb4dadf23d615a5f3a26aba1d4e37178f (diff)
parent4730314a70119ae5857edffe2d1bec86960ef22b (diff)
downloadmariadb-git-394784095eeedb3a2915249fe14a9d2e1f91a23a.tar.gz
Merge 10.3 into 10.4
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.result13
-rw-r--r--mysql-test/suite/parts/r/partition_alter_maria.result20
-rw-r--r--mysql-test/suite/parts/r/partition_alter_myisam.result20
4 files changed, 87 insertions, 3 deletions
diff --git a/mysql-test/suite/parts/inc/part_alter_values.inc b/mysql-test/suite/parts/inc/part_alter_values.inc
index ac69169a9ca..2f16476c78b 100644
--- a/mysql-test/suite/parts/inc/part_alter_values.inc
+++ b/mysql-test/suite/parts/inc/part_alter_values.inc
@@ -36,12 +36,43 @@ ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
);
DROP TABLE t1;
-#
-# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
-#
+--echo #
+--echo # MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
+--echo #
--eval create table t1 (i int) engine=$engine partition by range(i) (partition p0 values less than (10))
lock table t1 write;
--error ER_SAME_NAME_PARTITION
alter table t1 add partition (partition p0 values less than (20));
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
+
+--echo #
+--echo # MDEV-27065 Partitioning tables with custom data directories moves data back to default directory
+--echo #
+
+--mkdir $MYSQLTEST_VARDIR/tmp/mdev_27065
+
+--disable_query_log
+--eval CREATE TABLE t1 (id INT) ENGINE=$engine DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp/mdev_27065'
+--enable_query_log
+ALTER TABLE t1 PARTITION BY RANGE(id)(
+ PARTITION p0 VALUES LESS THAN (1000),
+ PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+DROP TABLE t1;
+
+# InnoDB doesn't support INDEX DIRECTORY.
+if (`SELECT IF('$engine' != 'InnoDB', 1, 0)`)
+{
+ --disable_query_log
+ --eval CREATE TABLE t2 (id INT) ENGINE=$engine INDEX DIRECTORY='$MYSQLTEST_VARDIR/tmp/mdev_27065'
+ --enable_query_log
+ ALTER TABLE t2 PARTITION BY RANGE(id)(
+ PARTITION p0 VALUES LESS THAN (1000),
+ PARTITION p1 VALUES LESS THAN MAXVALUE
+ );
+ DROP TABLE t2;
+}
+
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/mdev_27065 *
+--rmdir $MYSQLTEST_VARDIR/tmp/mdev_27065
diff --git a/mysql-test/suite/parts/r/partition_alter_innodb.result b/mysql-test/suite/parts/r/partition_alter_innodb.result
index f3921a1db26..ae3caaa4981 100644
--- a/mysql-test/suite/parts/r/partition_alter_innodb.result
+++ b/mysql-test/suite/parts/r/partition_alter_innodb.result
@@ -42,9 +42,22 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
+#
+# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
+#
create table t1 (i int) engine=InnoDB partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
+#
+# MDEV-27065 Partitioning tables with custom data directories moves data back to default directory
+#
+ALTER TABLE t1 PARTITION BY RANGE(id)(
+PARTITION p0 VALUES LESS THAN (1000),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+Warnings:
+Warning 1618 <DATA DIRECTORY> table option of old schema is ignored
+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 77f511d9b3b..358ffbdfbe7 100644
--- a/mysql-test/suite/parts/r/partition_alter_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter_maria.result
@@ -69,9 +69,29 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
+#
+# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
+#
create table t1 (i int) engine=Aria partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
+#
+# MDEV-27065 Partitioning tables with custom data directories moves data back to default directory
+#
+ALTER TABLE t1 PARTITION BY RANGE(id)(
+PARTITION p0 VALUES LESS THAN (1000),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+Warnings:
+Warning 1618 <DATA DIRECTORY> table option of old schema is ignored
+DROP TABLE t1;
+ALTER TABLE t2 PARTITION BY RANGE(id)(
+PARTITION p0 VALUES LESS THAN (1000),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+Warnings:
+Warning 1618 <INDEX DIRECTORY> table option of old schema is ignored
+DROP TABLE t2;
diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result
index ce3e04d6c97..9d76881fdfa 100644
--- a/mysql-test/suite/parts/r/partition_alter_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter_myisam.result
@@ -42,12 +42,32 @@ PARTITION p3 VALUES IN (4,5,6)
);
ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
DROP TABLE t1;
+#
+# MDEV-15456 Server crashes upon adding or dropping a partition in ALTER under LOCK TABLE after ER_SAME_NAME_PARTITION
+#
create table t1 (i int) engine=MyISAM partition by range(i) (partition p0 values less than (10));
lock table t1 write;
alter table t1 add partition (partition p0 values less than (20));
ERROR HY000: Duplicate partition name p0
alter table t1 add partition (partition p1 values less than (20)) /* comment */;
drop table t1;
+#
+# MDEV-27065 Partitioning tables with custom data directories moves data back to default directory
+#
+ALTER TABLE t1 PARTITION BY RANGE(id)(
+PARTITION p0 VALUES LESS THAN (1000),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+Warnings:
+Warning 1618 <DATA DIRECTORY> table option of old schema is ignored
+DROP TABLE t1;
+ALTER TABLE t2 PARTITION BY RANGE(id)(
+PARTITION p0 VALUES LESS THAN (1000),
+PARTITION p1 VALUES LESS THAN MAXVALUE
+);
+Warnings:
+Warning 1618 <INDEX DIRECTORY> table option of old schema is ignored
+DROP TABLE t2;
create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
partition by key(c1) (
partition p01 data directory = 'MYSQL_TMP_DIR'