summaryrefslogtreecommitdiff
path: root/sql/sql_partition_admin.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-08-06 00:36:40 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-08-06 00:36:40 -0400
commit4c69dc8116950d6bf0b09bfbc31a86d89831a364 (patch)
tree5a90c8458a2d2651b9638aa12a252db253e5b41f /sql/sql_partition_admin.cc
parent82cecb1c983737191804dfd170cafdf436158f80 (diff)
downloadmariadb-git-4c69dc8116950d6bf0b09bfbc31a86d89831a364.tar.gz
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.
Diffstat (limited to 'sql/sql_partition_admin.cc')
-rw-r--r--sql/sql_partition_admin.cc18
1 files changed, 17 insertions, 1 deletions
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 */