summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 1da73ab25df..172f90aa270 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2271,9 +2271,6 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv)
int error= 1;
DBUG_ENTER("binlog_savepoint_set");
- if (wsrep_emulate_bin_log)
- DBUG_RETURN(0);
-
char buf[1024];
String log_query(buf, sizeof(buf), &my_charset_bin);
@@ -2306,9 +2303,6 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv)
{
DBUG_ENTER("binlog_savepoint_rollback");
- if (wsrep_emulate_bin_log)
- DBUG_RETURN(0);
-
/*
Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some
non-transactional table. Otherwise, truncate the binlog cache starting
@@ -10798,18 +10792,20 @@ void wsrep_register_binlog_handler(THD *thd, bool trx)
back a statement or a transaction. However, notifications do not happen
if the binary log is set as read/write.
*/
- //binlog_cache_mngr *cache_mngr= thd_get_cache_mngr(thd);
binlog_cache_mngr *cache_mngr=
(binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton);
/* cache_mngr may be missing e.g. in mtr test ev51914.test */
- if (cache_mngr && cache_mngr->trx_cache.get_prev_position() == MY_OFF_T_UNDEF)
+ if (cache_mngr)
{
/*
Set an implicit savepoint in order to be able to truncate a trx-cache.
*/
- my_off_t pos= 0;
- binlog_trans_log_savepos(thd, &pos);
- cache_mngr->trx_cache.set_prev_position(pos);
+ if (cache_mngr->trx_cache.get_prev_position() == MY_OFF_T_UNDEF)
+ {
+ my_off_t pos= 0;
+ binlog_trans_log_savepos(thd, &pos);
+ cache_mngr->trx_cache.set_prev_position(pos);
+ }
/*
Set callbacks in order to be able to call commmit or rollback.