summaryrefslogtreecommitdiff
path: root/sql/rpl_mi.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-04-04 12:16:12 +0300
committerMonty <monty@mariadb.org>2018-05-07 00:07:32 +0300
commit30ebc3ee9efcab635b1f3e14b9198a58ae93c233 (patch)
tree81e3ad66cd4ec8693964317cbf23515d0e9ecf35 /sql/rpl_mi.cc
parenta22a339f8e044a1e8df011beb0b4c8f43792ac96 (diff)
downloadmariadb-git-30ebc3ee9efcab635b1f3e14b9198a58ae93c233.tar.gz
Add likely/unlikely to speed up execution
Added to: - if (error) - Lex - sql_yacc.yy and sql_yacc_ora.yy - In header files to alloc() calls - Added thd argument to thd_net_is_killed()
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r--sql/rpl_mi.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 1fc996b63af..6f659aa12ad 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -678,7 +678,7 @@ file '%s')", fname);
mi->rli.is_relay_log_recovery= FALSE;
// now change cache READ -> WRITE - must do this before flush_master_info
reinit_io_cache(&mi->file, WRITE_CACHE, 0L, 0, 1);
- if ((error= MY_TEST(flush_master_info(mi, TRUE, TRUE))))
+ if (unlikely((error= MY_TEST(flush_master_info(mi, TRUE, TRUE)))))
sql_print_error("Failed to flush master info file");
mysql_mutex_unlock(&mi->data_lock);
DBUG_RETURN(error);
@@ -1649,7 +1649,7 @@ bool Master_info_index::start_all_slaves(THD *thd)
error= start_slave(thd, mi, 1);
mi->release();
mysql_mutex_lock(&LOCK_active_mi);
- if (error)
+ if (unlikely(error))
{
my_error(ER_CANT_START_STOP_SLAVE, MYF(0),
"START",
@@ -1722,7 +1722,7 @@ bool Master_info_index::stop_all_slaves(THD *thd)
error= stop_slave(thd, mi, 1);
mi->release();
mysql_mutex_lock(&LOCK_active_mi);
- if (error)
+ if (unlikely(error))
{
my_error(ER_CANT_START_STOP_SLAVE, MYF(0),
"STOP",
@@ -2021,7 +2021,7 @@ bool Master_info_index::flush_all_relay_logs()
mi->release();
mysql_mutex_lock(&LOCK_active_mi);
- if (error)
+ if (unlikely(error))
{
result= true;
break;