[Commits] bb5f496: MDEV-13584 Assertion `!part_elem->tablespace_name && !table_create_info->tablespace' failed during EXCHANGE PARTITION with different TABLESPACE.

Alexey Botchkov holyfoot at askmonty.org
Tue Apr 17 15:12:10 EEST 2018


revision-id: bb5f4967f54d3f458bec86fb1845405a0a88bc0f (mariadb-10.3.6-14-gbb5f496)
parent(s): 02e897ca57168059c6a74d1129158afea93aa875
committer: Alexey Botchkov
timestamp: 2018-04-17 16:10:47 +0400
message:

MDEV-13584 Assertion `!part_elem->tablespace_name && !table_create_info->tablespace' failed during EXCHANGE PARTITION with different TABLESPACE.

Wrong DBUG_ASSERT just removed.

---
 mysql-test/main/partition_exchange.result | 11 +++++++++++
 mysql-test/main/partition_exchange.test   | 13 +++++++++++++
 sql/sql_partition.cc                      |  2 --
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/mysql-test/main/partition_exchange.result b/mysql-test/main/partition_exchange.result
index 3bce5ae..b27da5b 100644
--- a/mysql-test/main/partition_exchange.result
+++ b/mysql-test/main/partition_exchange.result
@@ -1297,3 +1297,14 @@ SHOW WARNINGS;
 Level	Code	Message
 UNLOCK TABLES;
 DROP TABLE t, t2, tp;
+#
+# Assertion `!part_elem->tablespace_name && !table_create_info->tablespace' 
+#                failed during EXCHANGE PARTITION with different TABLESPACE.
+#
+CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10;
+ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`);
+CREATE TABLE t2 like t1;
+ALTER TABLE t2 REMOVE PARTITIONING;
+ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
+ERROR HY000: Non matching attribute 'TABLESPACE' between partition and table
+DROP TABLE t1, t2;
diff --git a/mysql-test/main/partition_exchange.test b/mysql-test/main/partition_exchange.test
index 8dc40da..cb33b8d 100644
--- a/mysql-test/main/partition_exchange.test
+++ b/mysql-test/main/partition_exchange.test
@@ -523,3 +523,16 @@ UNLOCK TABLES;
 dec $count;
 }
 DROP TABLE t, t2, tp;
+
+--echo #
+--echo # Assertion `!part_elem->tablespace_name && !table_create_info->tablespace' 
+--echo #                failed during EXCHANGE PARTITION with different TABLESPACE.
+--echo #
+CREATE TABLE t1 (a VARCHAR(200)) PARTITION BY KEY(a) partitions 10;
+ALTER TABLE t1 ADD PARTITION (PARTITION pm TABLESPACE = `innodb_file_per_table`);
+CREATE TABLE t2 like t1;
+ALTER TABLE t2 REMOVE PARTITIONING;
+--error ER_PARTITION_EXCHANGE_DIFFERENT_OPTION
+ALTER TABLE t1 EXCHANGE PARTITION pm WITH TABLE t2;
+DROP TABLE t1, t2;
+
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index 94e90e1..c5c39a2 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4762,8 +4762,6 @@ bool compare_partition_options(HA_CREATE_INFO *table_create_info,
   const char *option_diffs[MAX_COMPARE_PARTITION_OPTION_ERRORS + 1];
   int i, errors= 0;
   DBUG_ENTER("compare_partition_options");
-  DBUG_ASSERT(!part_elem->tablespace_name &&
-              !table_create_info->tablespace);
 
   /*
     Note that there are not yet any engine supporting tablespace together


More information about the commits mailing list