summaryrefslogtreecommitdiff
path: root/sql/sql_parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.h')
-rw-r--r--sql/sql_parse.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/sql/sql_parse.h b/sql/sql_parse.h
index fa414911093..c3844bcc83f 100644
--- a/sql/sql_parse.h
+++ b/sql/sql_parse.h
@@ -208,6 +208,34 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
{
return MY_TEST(cs->mbminlen == 1);
}
+#ifdef WITH_WSREP
+#define WSREP_MYSQL_DB (char *)"mysql"
+#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
+ if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+
+#define WSREP_TO_ISOLATION_END \
+ if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
+ wsrep_to_isolation_end(thd);
+
+/* Checks if lex->no_write_to_binlog is set for statements that use
+ LOCAL or NO_WRITE_TO_BINLOG
+*/
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
+ if (WSREP(thd) && !thd->lex->no_write_to_binlog \
+ && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
+
+#define WSREP_SYNC_WAIT(thd_, before_) \
+ { if (WSREP_CLIENT(thd_) && \
+ wsrep_sync_wait(thd_, before_)) goto error; }
+
+#else
+
+#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
+#define WSREP_TO_ISOLATION_END
+#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
+#define WSREP_SYNC_WAIT(thd_, before_)
+
+#endif /* WITH_WSREP */
#endif /* SQL_PARSE_INCLUDED */