summaryrefslogtreecommitdiff
path: root/sql/wsrep_hton.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-02-24 01:21:40 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-24 01:21:40 -0500
commitcceec7858f260be23b50265fb026ea68c6aefc20 (patch)
tree52251df59c4a69527435c8d682505537fb6e9692 /sql/wsrep_hton.cc
parent88576b3a805f97be44d98143b6cdfc9b820fcc84 (diff)
parentf67d6fccacfb8a2963f23448cabb67c6178d2a10 (diff)
downloadmariadb-git-cceec7858f260be23b50265fb026ea68c6aefc20.tar.gz
Merge branch '10.0-galera' into bb-10.1-serg
Diffstat (limited to 'sql/wsrep_hton.cc')
-rw-r--r--sql/wsrep_hton.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/sql/wsrep_hton.cc b/sql/wsrep_hton.cc
index 5bec467708c..3bce8ba7128 100644
--- a/sql/wsrep_hton.cc
+++ b/sql/wsrep_hton.cc
@@ -22,6 +22,7 @@
#include "wsrep_xid.h"
#include <cstdio>
#include <cstdlib>
+#include "debug_sync.h"
extern ulonglong thd_to_trx_id(THD *thd);
@@ -67,6 +68,17 @@ void wsrep_register_hton(THD* thd, bool all)
if (WSREP(thd) && thd->wsrep_exec_mode != TOTAL_ORDER &&
!thd->wsrep_apply_toi)
{
+ if (thd->wsrep_exec_mode == LOCAL_STATE &&
+ (thd_sql_command(thd) == SQLCOM_OPTIMIZE ||
+ thd_sql_command(thd) == SQLCOM_ANALYZE ||
+ thd_sql_command(thd) == SQLCOM_REPAIR) &&
+ thd->lex->no_write_to_binlog == 1)
+ {
+ WSREP_DEBUG("Skipping wsrep_register_hton for LOCAL sql admin command : %s",
+ thd->query());
+ return;
+ }
+
THD_TRANS *trans=all ? &thd->transaction.all : &thd->transaction.stmt;
for (Ha_trx_info *i= trans->ha_list; i; i = i->next())
{
@@ -317,6 +329,8 @@ wsrep_run_wsrep_commit(THD *thd, bool all)
thd->get_stmt_da()->sql_errno(), thd->get_stmt_da()->message());
}
+ DEBUG_SYNC(thd, "wsrep_before_replication");
+
if (thd->slave_thread && !opt_log_slave_updates) DBUG_RETURN(WSREP_TRX_OK);
if (thd->wsrep_exec_mode == REPL_RECV) {