summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorDaniele Sciascia <daniele.sciascia@galeracluster.com>2015-10-20 17:54:14 +0200
committerNirbhay Choubey <nirbhay@mariadb.com>2016-02-22 17:46:22 -0500
commitace86a2375c3f47badf49796eda14959b0487269 (patch)
tree2287be909e31bbdd9ed914f3065d646b3ace6122 /sql/sql_class.cc
parentc1ea0570af88ed12f55fc20c54262b3688b9981d (diff)
downloadmariadb-git-ace86a2375c3f47badf49796eda14959b0487269.tar.gz
refs codership/mysql-wsrep#201
- Fixes query cache so that it is aware of wsrep_sync_wait. Query cache would return (possibly stale) results to the client, regardless of the value of wsrep_sync_wait. - Includes the test case that reproduced the issue.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 7705ac45ffa..fa26494f35b 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1213,6 +1213,7 @@ THD::THD()
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
+ wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
#endif
/* Call to init() below requires fully initialized Open_tables_state. */
reset_open_tables_state(this);
@@ -1628,6 +1629,7 @@ void THD::init(void)
wsrep_mysql_replicated = 0;
wsrep_TOI_pre_query = NULL;
wsrep_TOI_pre_query_len = 0;
+ wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
/*
@@wsrep_causal_reads is now being handled via wsrep_sync_wait, update it
@@ -2361,6 +2363,10 @@ void THD::cleanup_after_query()
rgi_slave->cleanup_after_query();
#endif
+#ifdef WITH_WSREP
+ wsrep_sync_wait_gtid= WSREP_GTID_UNDEFINED;
+#endif /* WITH_WSREP */
+
DBUG_VOID_RETURN;
}