diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 18 | ||||
-rw-r--r-- | sql/wsrep_high_priority_service.cc | 6 | ||||
-rw-r--r-- | sql/wsrep_thd.cc | 7 |
3 files changed, 12 insertions, 19 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. diff --git a/sql/wsrep_high_priority_service.cc b/sql/wsrep_high_priority_service.cc index ef9a46f1a8e..9f6cbf30e68 100644 --- a/sql/wsrep_high_priority_service.cc +++ b/sql/wsrep_high_priority_service.cc @@ -453,11 +453,15 @@ Wsrep_applier_service::Wsrep_applier_service(THD* thd) thd->wsrep_cs().open(wsrep::client_id(thd->thread_id)); thd->wsrep_cs().before_command(); thd->wsrep_cs().debug_log_level(wsrep_debug); - + if (!thd->slave_thread) + thd->system_thread_info.rpl_sql_info= + new rpl_sql_thread_info(thd->wsrep_rgi->rli->mi->rpl_filter); } Wsrep_applier_service::~Wsrep_applier_service() { + if (!m_thd->slave_thread) + delete m_thd->system_thread_info.rpl_sql_info; m_thd->wsrep_cs().after_command_before_result(); m_thd->wsrep_cs().after_command_after_result(); m_thd->wsrep_cs().close(); diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index b605ff0496d..94d01b273c5 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -53,11 +53,6 @@ static void wsrep_replication_process(THD *thd, Wsrep_applier_service applier_service(thd); - /* thd->system_thread_info.rpl_sql_info isn't initialized. */ - if (!thd->slave_thread) - thd->system_thread_info.rpl_sql_info= - new rpl_sql_thread_info(thd->wsrep_rgi->rli->mi->rpl_filter); - WSREP_INFO("Starting applier thread %llu", thd->thread_id); enum wsrep::provider::status ret= Wsrep_server_state::get_provider().run_applier(&applier_service); @@ -68,8 +63,6 @@ static void wsrep_replication_process(THD *thd, mysql_cond_broadcast(&COND_wsrep_slave_threads); mysql_mutex_unlock(&LOCK_wsrep_slave_threads); - if (!thd->slave_thread) - delete thd->system_thread_info.rpl_sql_info; delete thd->wsrep_rgi->rli->mi; delete thd->wsrep_rgi->rli; |