summaryrefslogtreecommitdiff
path: root/mysql-test/r/partition_alter.result
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2020-11-18 14:37:44 +0100
committerOlivier Bertrand <bertrandop@gmail.com>2020-11-18 14:37:44 +0100
commit9055db73d5b43b241730e643f220dfa5e35eb7c1 (patch)
tree972d9bf5049c7687702196c77281f4419ceba2df /mysql-test/r/partition_alter.result
parent8771390dfd3a98ae47b76b5f262af76aa8232cd7 (diff)
parent9b30212f15e280bef6d2a9be212c3295e912b959 (diff)
downloadmariadb-git-9055db73d5b43b241730e643f220dfa5e35eb7c1.tar.gz
Commit new source and all recent changes.
Diffstat (limited to 'mysql-test/r/partition_alter.result')
-rw-r--r--mysql-test/r/partition_alter.result44
1 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result
index 1dced95b17a..699377751d1 100644
--- a/mysql-test/r/partition_alter.result
+++ b/mysql-test/r/partition_alter.result
@@ -122,3 +122,47 @@ t1 CREATE TABLE `t1` (
PARTITION `p02` ENGINE = MyISAM,
PARTITION `p03` ENGINE = MyISAM)
drop table t1;
+#
+# MDEV-19751 Wrong partitioning by KEY() after key dropped
+#
+create or replace table t1 (pk int, x timestamp(6), primary key (pk, x)) engine innodb
+partition by key() partitions 2;
+insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
+# Inplace for DROP PRIMARY KEY when partitioned by default field list is denied
+alter table t1 drop primary key, drop column x, add primary key (pk), algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+alter table t1 drop primary key, drop column x, add primary key (pk);
+select * from t1 partition (p0);
+pk
+1
+drop table t1;
+create or replace table t1 (pk int not null, x timestamp(6), unique u(pk, x)) engine innodb
+partition by key() partitions 2;
+insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
+# Same for NOT NULL UNIQUE KEY as this is actually primary key
+alter table t1 drop key u, drop column x, add unique (pk), algorithm=inplace;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
+alter table t1 drop key u, drop column x, add unique (pk);
+select * from t1 partition (p0);
+pk
+1
+drop table t1;
+create or replace table t1 (pk int, x timestamp(6), primary key (pk)) engine innodb
+partition by key(pk) partitions 2;
+insert into t1 (pk, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
+# Inplace for DROP PRIMARY KEY when partitioned by explicit field list is allowed
+alter table t1 drop primary key, add primary key (pk, x), algorithm=inplace;
+select * from t1 partition (p0);
+pk x
+1 2000-01-01 00:00:00.000000
+drop table t1;
+create or replace table t1 (k int, x timestamp(6), unique key u (x, k)) engine innodb
+partition by key(k) partitions 2;
+insert into t1 (k, x) values (1, '2000-01-01 00:00'), (2, '2000-01-01 00:01');
+# Inplace for DROP KEY is allowed
+alter table t1 drop key u, algorithm=inplace;
+select * from t1 partition (p0);
+k x
+1 2000-01-01 00:00:00.000000
+drop table t1;
+# End of 10.2 tests