summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-12-19 15:55:55 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-12-19 15:55:55 -0500
commitd51e7f90bfb59676e21c128cf84cf54c2023b058 (patch)
treedeace92338b34f16fd07d487f7237ee9bfacaa01
parent9d8ec1468ad94f56c7a0e12b596c18c5a842b8e3 (diff)
downloadmariadb-git-d51e7f90bfb59676e21c128cf84cf54c2023b058.tar.gz
MDEV-10957: Assertion failure when dropping a myisam table
... with wsrep_replicate_myisam enabled Internal updates to system statistical tables could wrongly trigger an additional total-order replication if wsrep_repli -cate_myisam is enabled. Fixed by adding a check to skip total-order replication for stat tables.
-rw-r--r--sql/sql_base.cc1
-rw-r--r--sql/sql_statistics.cc18
-rw-r--r--sql/sql_statistics.h1
3 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 1ca7e9c1574..0a39d74cbf8 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4068,6 +4068,7 @@ restart:
(*start) &&
(*start)->table &&
(*start)->table->file->ht == myisam_hton &&
+ !is_stat_table((*start)->db, (*start)->alias) &&
sqlcom_can_generate_row_events(thd) &&
thd->get_command() != COM_STMT_PREPARE)
{
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc
index e557a009686..adbc52d1eec 100644
--- a/sql/sql_statistics.cc
+++ b/sql/sql_statistics.cc
@@ -3849,3 +3849,21 @@ double Histogram::point_selectivity(double pos, double avg_sel)
return sel;
}
+/*
+ Check whether the table is one of the persistent statistical tables.
+*/
+bool is_stat_table(const char *db, const char *table)
+{
+ DBUG_ASSERT(db && table);
+
+ if (!memcmp(db, stat_tables_db_name.str, stat_tables_db_name.length))
+ {
+ for (uint i= 0; i < STATISTICS_TABLES; i ++)
+ {
+ if (!memcmp(table, stat_table_name[i].str, stat_table_name[i].length))
+ return true;
+ }
+ }
+ return false;
+}
+
diff --git a/sql/sql_statistics.h b/sql/sql_statistics.h
index 46e5cef22d1..daffd792ba0 100644
--- a/sql/sql_statistics.h
+++ b/sql/sql_statistics.h
@@ -107,6 +107,7 @@ double get_column_range_cardinality(Field *field,
key_range *min_endp,
key_range *max_endp,
uint range_flag);
+bool is_stat_table(const char *db, const char *table);
class Histogram
{