summaryrefslogtreecommitdiff
path: root/sql/wsrep_applier.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-12-05 20:58:49 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-12-12 08:51:50 -0500
commit67b570af506a42f14a8ae30603d52ca9de68cce5 (patch)
tree6e0fae5738f79c603f7e9e00fb7332ec658d7f13 /sql/wsrep_applier.cc
parent9c88a54c1064ebdcf461e6c524a36ce5cc9370bd (diff)
downloadmariadb-git-67b570af506a42f14a8ae30603d52ca9de68cce5.tar.gz
MDEV-10545: Server crashed in my_copy_fix_mb on querying I_S and P_S tables
After applying/replaying the transaction, the memory that stored the query string was also wrongly freed.
Diffstat (limited to 'sql/wsrep_applier.cc')
-rw-r--r--sql/wsrep_applier.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc
index b9c259f7b5e..e10c19287c4 100644
--- a/sql/wsrep_applier.cc
+++ b/sql/wsrep_applier.cc
@@ -365,8 +365,10 @@ wsrep_cb_status_t wsrep_commit_cb(void* const ctx,
else
rcode = wsrep_rollback(thd);
+ /* Cleanup */
wsrep_set_apply_format(thd, NULL);
thd->mdl_context.release_transactional_locks();
+ thd->reset_query(); /* Mutex protected */
free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC));
thd->tx_isolation= (enum_tx_isolation) thd->variables.tx_isolation;