diff --git a/sql/ha_partition.h b/sql/ha_partition.h index ebf9dcdb842..ac2a233427d 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1171,6 +1171,13 @@ public: DBUG_ASSERT(h == m_file[i]->ht); return h; } +#ifdef WITH_WSREP + void wsrep_reset_files() + { + for (uint i=0; i < m_tot_parts; i++) + m_file[i]->ha_start_of_new_statement(); + } +#endif /* WITH_WSREP */ }; #endif /* HA_PARTITION_INCLUDED */ diff --git a/sql/table.cc b/sql/table.cc index 7635e03ad6b..eea905805f8 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -40,6 +40,9 @@ #include "sql_select.h" #include "sql_derived.h" #include "mdl.h" // MDL_wait_for_graph_visitor +#ifdef WITH_WSREP +#include "ha_partition.h" +#endif /* WITH_WSREP */ /* INFORMATION_SCHEMA name */ LEX_STRING INFORMATION_SCHEMA_NAME= {C_STRING_WITH_LEN("information_schema")}; @@ -3930,6 +3933,12 @@ void TABLE::init(THD *thd, TABLE_LIST *tl) insert_values= 0; fulltext_searched= 0; file->ha_start_of_new_statement(); +#ifdef WITH_WSREP + if (file->ht->db_type == DB_TYPE_PARTITION_DB) + { + ((ha_partition*)file)->wsrep_reset_files(); + } +#endif reginfo.impossible_range= 0; created= TRUE;