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/log_event.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/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 20a8bed5623..3889c4a6616 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -9895,7 +9895,18 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) } #ifdef HAVE_QUERY_CACHE +#ifdef WITH_WSREP + /* + Moved invalidation right before the call to rows_event_stmt_cleanup(), + to avoid query cache being polluted with stale entries. + */ + if (! (WSREP(thd) && (thd->wsrep_exec_mode == REPL_RECV))) + { +#endif /* WITH_WSREP */ query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock); +#ifdef WITH_WSREP + } +#endif /* WITH_WSREP */ #endif } @@ -10087,6 +10098,14 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi) /* remove trigger's tables */ if (slave_run_triggers_for_rbr) restore_empty_query_table_list(thd->lex); + +#if defined(WITH_WSREP) && defined(HAVE_QUERY_CACHE) + if (WSREP(thd) && thd->wsrep_exec_mode == REPL_RECV) + { + query_cache.invalidate_locked_for_write(thd, rgi->tables_to_lock); + } +#endif /* WITH_WSREP && HAVE_QUERY_CACHE */ + if (get_flags(STMT_END_F) && (error= rows_event_stmt_cleanup(rgi, thd))) slave_rows_error_report(ERROR_LEVEL, thd->is_error() ? 0 : error, |