diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-24 01:21:40 -0500 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2016-02-24 01:21:40 -0500 |
commit | cceec7858f260be23b50265fb026ea68c6aefc20 (patch) | |
tree | 52251df59c4a69527435c8d682505537fb6e9692 /sql/sql_cache.cc | |
parent | 88576b3a805f97be44d98143b6cdfc9b820fcc84 (diff) | |
parent | f67d6fccacfb8a2963f23448cabb67c6178d2a10 (diff) | |
download | mariadb-git-cceec7858f260be23b50265fb026ea68c6aefc20.tar.gz |
Merge branch '10.0-galera' into bb-10.1-serg
Diffstat (limited to 'sql/sql_cache.cc')
-rw-r--r-- | sql/sql_cache.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 03505dec0cf..91dd8ad7325 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1933,6 +1933,13 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", (int)flags.autocommit)); memcpy((uchar *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)), (uchar*) &flags, QUERY_CACHE_FLAGS_SIZE); + +#ifdef WITH_WSREP + bool once_more; + once_more= true; +lookup: +#endif /* WITH_WSREP */ + query_block = (Query_cache_block *) my_hash_search(&queries, (uchar*) sql, tot_length); /* Quick abort on unlocked data */ @@ -1945,6 +1952,19 @@ def_week_frmt: %lu, in_trans: %d, autocommit: %d", } DBUG_PRINT("qcache", ("Query in query hash 0x%lx", (ulong)query_block)); +#ifdef WITH_WSREP + if (once_more && WSREP_CLIENT(thd) && wsrep_must_sync_wait(thd)) + { + unlock(); + if (wsrep_sync_wait(thd)) + goto err; + if (try_lock(thd, Query_cache::TIMEOUT)) + goto err; + once_more= false; + goto lookup; + } +#endif /* WITH_WSREP */ + /* Now lock and test that nothing changed while blocks was unlocked */ BLOCK_LOCK_RD(query_block); |