Commit 3daf89ce authored by Nirbhay Choubey's avatar Nirbhay Choubey

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.

Test: galera.galera_var_replicate_myisam_on
parent 6dbfe7f3
...@@ -4736,6 +4736,7 @@ bool open_tables(THD *thd, const DDL_options_st &options, ...@@ -4736,6 +4736,7 @@ bool open_tables(THD *thd, const DDL_options_st &options,
(*start) && (*start) &&
(*start)->table && (*start)->table &&
(*start)->table->file->ht == myisam_hton && (*start)->table->file->ht == myisam_hton &&
!is_stat_table((*start)->db, (*start)->alias) &&
sqlcom_can_generate_row_events(thd) && sqlcom_can_generate_row_events(thd) &&
thd->get_command() != COM_STMT_PREPARE) thd->get_command() != COM_STMT_PREPARE)
{ {
......
...@@ -3840,3 +3840,21 @@ double Histogram::point_selectivity(double pos, double avg_sel) ...@@ -3840,3 +3840,21 @@ double Histogram::point_selectivity(double pos, double avg_sel)
return 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;
}
...@@ -107,6 +107,7 @@ double get_column_range_cardinality(Field *field, ...@@ -107,6 +107,7 @@ double get_column_range_cardinality(Field *field,
key_range *min_endp, key_range *min_endp,
key_range *max_endp, key_range *max_endp,
uint range_flag); uint range_flag);
bool is_stat_table(const char *db, const char *table);
class Histogram class Histogram
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment