summaryrefslogtreecommitdiff
path: root/sql/wsrep_applier.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-03-05 14:14:00 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-03-05 14:14:00 -0500
commit9af42db6138a555454b7631761b81f8d259f014e (patch)
treeff1ff849521a70cd25251e661d1eb8ee960e587f /sql/wsrep_applier.cc
parent73a143ab34be0007cc0fc17cf5fda00fef063c1c (diff)
downloadmariadb-git-9af42db6138a555454b7631761b81f8d259f014e.tar.gz
MDEV-7192: binlog_annotate_row_events not completely compatible with galera
Annotate_rows event needs to be preserved until the last Rows event has been applied because after it has been applied thd->query points to the query stored inside this event.
Diffstat (limited to 'sql/wsrep_applier.cc')
-rw-r--r--sql/wsrep_applier.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index 03d356aa046..6f1ead89158 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -92,6 +92,7 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
char *buf= (char *)events_buf;
int rcode= 0;
int event= 1;
+ Log_event_type typ;
DBUG_ENTER("wsrep_apply_events");
@@ -126,7 +127,9 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
goto error;
}
- switch (ev->get_type_code()) {
+ typ= ev->get_type_code();
+
+ switch (typ) {
case FORMAT_DESCRIPTION_EVENT:
wsrep_set_apply_format(thd, (Format_description_log_event*)ev);
continue;
@@ -160,7 +163,6 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
}
ev->thd = thd;
- //exec_res = ev->apply_event(thd->wsrep_rli);
exec_res = ev->apply_event(thd->wsrep_rgi);
DBUG_PRINT("info", ("exec_event result: %d", exec_res));
@@ -192,7 +194,7 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
DBUG_RETURN(WSREP_CB_FAILURE);
}
- delete ev;
+ delete_or_keep_event_post_apply(thd->wsrep_rgi, typ, ev);
}
error: