diff options
author | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2021-10-29 19:04:53 +0900 |
---|---|---|
committer | Nayuta Yanagisawa <nayuta.yanagisawa@hey.com> | 2021-10-29 19:18:09 +0900 |
commit | 71326717c28d4235bad7a926b8ec5a2e81a52152 (patch) | |
tree | afa58cd44f1625a7ab618e73bb17350ba83e8470 | |
parent | 42ae765960869a7ce381341d7b98c1e8aa157b29 (diff) | |
download | mariadb-git-bb-10.2-mdev-26127.tar.gz |
MDEV-26127 Assertion `err != DB_DUPLICATE_KEY' failed or InnoDB: Failing assertion: id != 0 on ALTER ... REBUILD PARTITIONbb-10.2-mdev-26127
-rw-r--r-- | mysql-test/suite/parts/r/mdev_26127.result | 6 | ||||
-rw-r--r-- | mysql-test/suite/parts/t/mdev_26127.test | 11 | ||||
-rw-r--r-- | sql/ha_partition.cc | 2 |
3 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/suite/parts/r/mdev_26127.result b/mysql-test/suite/parts/r/mdev_26127.result new file mode 100644 index 00000000000..416ea4159c7 --- /dev/null +++ b/mysql-test/suite/parts/r/mdev_26127.result @@ -0,0 +1,6 @@ +CREATE TABLE t ( +c INT +) ENGINE=InnoDB PARTITION BY LINEAR KEY(c) PARTITIONS 4; +LOCK TABLES t WRITE, t AS a READ; +ALTER TABLE t REBUILD PARTITION p0; +DROP TABLE t; diff --git a/mysql-test/suite/parts/t/mdev_26127.test b/mysql-test/suite/parts/t/mdev_26127.test new file mode 100644 index 00000000000..40b213e5170 --- /dev/null +++ b/mysql-test/suite/parts/t/mdev_26127.test @@ -0,0 +1,11 @@ +--source include/have_innodb.inc +--source include/have_partition.inc + +CREATE TABLE t ( + c INT +) ENGINE=InnoDB PARTITION BY LINEAR KEY(c) PARTITIONS 4; + +LOCK TABLES t WRITE, t AS a READ; +ALTER TABLE t REBUILD PARTITION p0; + +DROP TABLE t; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 4345f9eb9ca..2e1e10bd0ce 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1046,6 +1046,8 @@ int ha_partition::rename_partitions(const char *path) error= 1; (void) sync_ddl_log(); } + if (error) + DBUG_RETURN(error); file= m_new_file[i]; DBUG_PRINT("info", ("Rename partition from %s to %s", part_name_buff, norm_name_buff)); |