summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r--sql/rpl_rli.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index 04109ddadb4..9e09a5cf067 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -142,7 +142,7 @@ int Relay_log_info::init(const char* info_fname)
log_space_limit= relay_log_space_limit;
log_space_total= 0;
- if (error_on_rli_init_info)
+ if (unlikely(error_on_rli_init_info))
goto err;
char pattern[FN_REFLEN];
@@ -306,7 +306,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
fname);
error= 1;
}
- if (error)
+ if (unlikely(error))
{
if (info_fd >= 0)
mysql_file_close(info_fd, MYF(0));
@@ -415,7 +415,7 @@ Failed to open the existing relay log info file '%s' (errno %d)",
before Relay_log_info::flush()
*/
reinit_io_cache(&info_file, WRITE_CACHE,0L,0,1);
- if ((error= flush()))
+ if (unlikely((error= flush())))
{
msg= "Failed to flush relay log info file";
goto err;
@@ -1520,7 +1520,7 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array,
LEX_CSTRING *tablename, void **out_hton)
{
TABLE_LIST tlist;
- TABLE *table;
+ TABLE *UNINIT_VAR(table);
bool table_opened= false;
bool table_scanned= false;
struct gtid_pos_element tmp_entry, *entry;
@@ -1537,11 +1537,9 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array,
goto end;
bitmap_set_all(table->read_set);
- if ((err= table->file->ha_rnd_init_with_error(1)))
- {
- table->file->print_error(err, MYF(0));
+ if (unlikely(err= table->file->ha_rnd_init_with_error(1)))
goto end;
- }
+
table_scanned= true;
for (;;)
{
@@ -1551,9 +1549,7 @@ scan_one_gtid_slave_pos_table(THD *thd, HASH *hash, DYNAMIC_ARRAY *array,
if ((err= table->file->ha_rnd_next(table->record[0])))
{
- if (err == HA_ERR_RECORD_DELETED)
- continue;
- else if (err == HA_ERR_END_OF_FILE)
+ if (err == HA_ERR_END_OF_FILE)
break;
else
{
@@ -1784,6 +1780,8 @@ gtid_pos_auto_create_tables(rpl_slave_state::gtid_pos_table **list_ptr)
p= strmake(p, plugin_name(*auto_engines)->str, FN_REFLEN - (p - buf));
table_name.str= buf;
table_name.length= p - buf;
+ table_case_convert(const_cast<char*>(table_name.str),
+ static_cast<uint>(table_name.length));
entry= rpl_global_gtid_slave_state->alloc_gtid_pos_table
(&table_name, hton, rpl_slave_state::GTID_POS_AUTO_CREATE);
if (!entry)
@@ -2208,7 +2206,7 @@ void rpl_group_info::cleanup_context(THD *thd, bool error)
to rollback before continuing with the next events.
4) so we need this "context cleanup" function.
*/
- if (error)
+ if (unlikely(error))
{
trans_rollback_stmt(thd); // if a "statement transaction"
/* trans_rollback() also resets OPTION_GTID_BEGIN */
@@ -2222,7 +2220,7 @@ void rpl_group_info::cleanup_context(THD *thd, bool error)
m_table_map.clear_tables();
slave_close_thread_tables(thd);
- if (error)
+ if (unlikely(error))
{
thd->mdl_context.release_transactional_locks();