From 4c69dc8116950d6bf0b09bfbc31a86d89831a364 Mon Sep 17 00:00:00 2001 From: Nirbhay Choubey Date: Thu, 6 Aug 2015 00:36:40 -0400 Subject: MDEV#7501 : alter table exchange partition is not replicated in galera cluster Added logic to replicate ALTER TABLE EXCHANGE PARTITION to other nodes in the cluster. --- sql/sql_partition_admin.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sql/sql_partition_admin.cc') diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 029744b63f5..1d5cebfbbfd 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -530,6 +530,21 @@ bool Sql_cmd_alter_table_exchange_partition:: &alter_prelocking_strategy)) DBUG_RETURN(true); +#ifdef WITH_WSREP + /* Forward declaration */ + TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); + + if ((!thd->is_current_stmt_binlog_format_row() || + /* TODO: Do we really need to check for temp tables in this case? */ + !find_temporary_table(thd, table_list)) && + wsrep_to_isolation_begin(thd, table_list->db, table_list->table_name, + NULL)) + { + WSREP_WARN("ALTER TABLE EXCHANGE PARTITION isolation failure"); + DBUG_RETURN(TRUE); + } +#endif /* WITH_WSREP */ + part_table= table_list->table; swap_table= swap_table_list->table; @@ -764,6 +779,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd) DBUG_RETURN(TRUE); #ifdef WITH_WSREP + /* Forward declaration */ TABLE *find_temporary_table(THD *thd, const TABLE_LIST *tl); if ((!thd->is_current_stmt_binlog_format_row() || @@ -772,7 +788,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd) thd, first_table->db, first_table->table_name, NULL) ) { - WSREP_WARN("ALTER TABLE isolation failure"); + WSREP_WARN("ALTER TABLE TRUNCATE PARTITION isolation failure"); DBUG_RETURN(TRUE); } #endif /* WITH_WSREP */ -- cgit v1.2.1