summaryrefslogtreecommitdiff
path: root/mysql-test/main/partition_alter.result
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-27 17:10:39 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-27 17:10:39 +0300
commitdad7a8ee7dab99c0ba3d98ac12d0235462f3029e (patch)
treebdfa61bfebb73cf1c5c06a1e3931dd7d2d4b0d77 /mysql-test/main/partition_alter.result
parent7476e8c7cdd73d60294126a2840baee97e7644b6 (diff)
parent5139cfabb3bfc62be38e651ff176580e0aba09b8 (diff)
downloadmariadb-git-dad7a8ee7dab99c0ba3d98ac12d0235462f3029e.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/partition_alter.result')
-rw-r--r--mysql-test/main/partition_alter.result53
1 files changed, 51 insertions, 2 deletions
diff --git a/mysql-test/main/partition_alter.result b/mysql-test/main/partition_alter.result
index d946f2b8822..997a5cf97fa 100644
--- a/mysql-test/main/partition_alter.result
+++ b/mysql-test/main/partition_alter.result
@@ -122,7 +122,55 @@ t1 CREATE TABLE `t1` (
PARTITION `p02` ENGINE = MyISAM,
PARTITION `p03` ENGINE = MyISAM)
drop table t1;
-create or replace table t1 (x int) partition by hash (x) (partition p1, partition p2);
+#
+# 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
+#
+# MDEV-14817 Server crashes in prep_alter_part_table()
+# after table lock and multiple add partition
+#
+create table t1 (x int) partition by hash (x) (partition p1, partition p2);
lock table t1 write;
alter table t1 add partition (partition p1);
ERROR HY000: Duplicate partition name p1
@@ -134,7 +182,7 @@ drop table t1;
# ha_partition::update_row or `part_id == m_last_part' in
# ha_partition::delete_row upon UPDATE/DELETE after dropping versioning
#
-create or replace table t1 (pk int, f int, primary key(pk, f)) engine=innodb
+create table t1 (pk int, f int, primary key(pk, f)) engine=innodb
partition by key() partitions 2;
insert into t1 values (1,10),(2,11);
# expected to hit same partition
@@ -152,3 +200,4 @@ pk
2
delete from t1;
drop table t1;
+# End of 10.3 tests