[Commits] d7dae31: MDEV-15167 Server crashes in in bitmap_bits_set upon REPAIR PARTITION...

sachin sachin.setiya at mariadb.com
Thu Apr 19 19:42:47 EEST 2018


revision-id: d7dae3119254776b290dba742d4cb9e2c12ff087 (mariadb-10.3.6-20-gd7dae31)
parent(s): 419385dbf10453b17a370fd9e5bd934d09e0b440
author: Sachin Setiya
committer: Sachin Setiya
timestamp: 2018-04-19 22:11:41 +0530
message:

MDEV-15167 Server crashes in in bitmap_bits_set upon REPAIR PARTITION...
after rebuilding under test_pseudo_invisible

If we are doing alter related to partitioning then simple alter stmt
like adding column(or any alter stmt) can't be combined with partition
alter, this will generate a syntax error.

But IF we add
SET debug_dbug="+d,test_pseudo_invisible";
or test_completely_invisible
this will add a column to table  with have an already partitioning related
alter. This execution of wrong stmt will crash the server on later stages.
(like on repair partition).

So we will simply return 1 (and ER_INTERNAL_ERROR) if we any of these
debug_dbug flags turned on.

---
 mysql-test/main/invisible_partition.result | 10 ++++++++++
 mysql-test/main/invisible_partition.test   | 13 +++++++++++++
 sql/sql_partition.cc                       | 11 +++++++++++
 3 files changed, 34 insertions(+)

diff --git a/mysql-test/main/invisible_partition.result b/mysql-test/main/invisible_partition.result
new file mode 100644
index 0000000..b2915c8
--- /dev/null
+++ b/mysql-test/main/invisible_partition.result
@@ -0,0 +1,10 @@
+CREATE TABLE t1 (a INT NOT NULL, KEY (a)) ENGINE=MEMORY PARTITION BY KEY(a) PARTITIONS 4;
+INSERT INTO t1 VALUES (1),(2);
+SET debug_dbug="+d,test_pseudo_invisible";
+ALTER TABLE t1 REBUILD PARTITION p2;
+ERROR HY000: Internal error: Don't to it with test_pseudo_invisible
+SET debug_dbug='';
+ALTER TABLE t1 REPAIR PARTITION p1,p2,p3;
+Table	Op	Msg_type	Msg_text
+test.t1	repair	status	OK
+Drop table t1;
diff --git a/mysql-test/main/invisible_partition.test b/mysql-test/main/invisible_partition.test
new file mode 100644
index 0000000..85bd30e
--- /dev/null
+++ b/mysql-test/main/invisible_partition.test
@@ -0,0 +1,13 @@
+--source include/have_partition.inc
+--source include/have_binlog_format_row.inc
+
+CREATE TABLE t1 (a INT NOT NULL, KEY (a)) ENGINE=MEMORY PARTITION BY KEY(a) PARTITIONS 4;
+INSERT INTO t1 VALUES (1),(2);
+SET debug_dbug="+d,test_pseudo_invisible";
+--error ER_INTERNAL_ERROR
+ALTER TABLE t1 REBUILD PARTITION p2;
+SET debug_dbug='';
+ALTER TABLE t1 REPAIR PARTITION p1,p2,p3;
+
+# Cleanup
+Drop table t1;
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index c5c39a2..634c120 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4872,6 +4872,17 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
        ALTER_PARTITION_TABLE_REORG |
        ALTER_PARTITION_REBUILD))
   {
+    /*
+      You can't add column when we are doing alter related to partition
+    */
+    DBUG_EXECUTE_IF("test_pseudo_invisible", {
+         my_error(ER_INTERNAL_ERROR, MYF(0), "Don't to it with test_pseudo_invisible");
+         DBUG_RETURN(1);
+         });
+    DBUG_EXECUTE_IF("test_completely_invisible", {
+         my_error(ER_INTERNAL_ERROR, MYF(0), "Don't to it with test_completely_invisible");
+         DBUG_RETURN(1);
+         });
     partition_info *tab_part_info;
     ulonglong flags= 0;
     bool is_last_partition_reorged= FALSE;


More information about the commits mailing list