summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-06-06 16:22:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-06-06 16:22:09 +0300
commit57d4a242dac0238dd63ac05cd9d65a38d75a5d5f (patch)
tree323a71a864c38fe00502bd95926b4d05ab6854d6 /sql/log.cc
parente097abfa662751cc337febad9d8584159f23cc92 (diff)
parent7e39470e337aeeab4ee3e73336c2fff88609529f (diff)
downloadmariadb-git-57d4a242dac0238dd63ac05cd9d65a38d75a5d5f.tar.gz
Merge 10.7 into 10.8
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 0eb477fc034..115b1301108 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2264,7 +2264,13 @@ int binlog_commit(THD *thd, bool all, bool ro_1pc)
thd->backup_stage(&org_stage);
THD_STAGE_INFO(thd, stage_binlog_write);
+#ifdef WITH_WSREP
+ // DON'T clear stmt cache in case we are in transaction
+ if (!cache_mngr->stmt_cache.empty() &&
+ (!wsrep_on(thd) || ending_trans(thd, all)))
+#else
if (!cache_mngr->stmt_cache.empty())
+#endif
{
error= binlog_commit_flush_stmt_cache(thd, all, cache_mngr);
}
@@ -11917,13 +11923,13 @@ maria_declare_plugin_end;
#ifdef WITH_WSREP
#include "wsrep_mysqld.h"
-IO_CACHE *wsrep_get_trans_cache(THD * thd)
+IO_CACHE *wsrep_get_cache(THD * thd, bool is_transactional)
{
DBUG_ASSERT(binlog_hton->slot != HA_SLOT_UNDEF);
binlog_cache_mngr *cache_mngr = (binlog_cache_mngr*)
thd_get_ha_data(thd, binlog_hton);
if (cache_mngr)
- return cache_mngr->get_binlog_cache_log(true);
+ return cache_mngr->get_binlog_cache_log(is_transactional);
WSREP_DEBUG("binlog cache not initialized, conn: %llu",
thd->thread_id);