summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/mysqld.cc4
-rw-r--r--sql/rpl_gtid.cc3
-rw-r--r--sql/sys_vars.cc6
3 files changed, 9 insertions, 4 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0aaa3ee59e7..a42d789698e 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -840,8 +840,8 @@ static PSI_mutex_info all_server_mutexes[]=
{ &key_LOG_INFO_lock, "LOG_INFO::lock", 0},
{ &key_LOCK_thread_count, "LOCK_thread_count", PSI_FLAG_GLOBAL},
{ &key_PARTITION_LOCK_auto_inc, "HA_DATA_PARTITION::LOCK_auto_inc", 0},
- { &key_LOCK_slave_state, "key_LOCK_slave_state", 0},
- { &key_LOCK_binlog_state, "key_LOCK_binlog_state", 0}
+ { &key_LOCK_slave_state, "LOCK_slave_state", 0},
+ { &key_LOCK_binlog_state, "LOCK_binlog_state", 0}
};
PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 7f5aa0b780b..6f45c4daf5c 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -295,6 +295,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
list_element *elist= 0, *next;
element *elem;
ulonglong thd_saved_option= thd->variables.option_bits;
+ Query_tables_list lex_backup;
mysql_reset_thd_for_next_command(thd, 0);
@@ -304,6 +305,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
return 1;
} );
+ thd->lex->reset_n_backup_query_tables_list(&lex_backup);
tlist.init_one_table(STRING_WITH_LEN("mysql"),
rpl_gtid_slave_state_table_name.str,
rpl_gtid_slave_state_table_name.length,
@@ -393,6 +395,7 @@ end:
else
thd->mdl_context.release_transactional_locks();
}
+ thd->lex->restore_backup_query_tables_list(&lex_backup);
thd->variables.option_bits= thd_saved_option;
return err;
}
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index 4c8e3050e33..d37fa869042 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -3424,7 +3424,8 @@ bool update_multi_source_variable(sys_var *self_var, THD *thd,
bool result= true;
Master_info *mi;
- mysql_mutex_unlock(&LOCK_global_system_variables);
+ if (type == OPT_GLOBAL)
+ mysql_mutex_unlock(&LOCK_global_system_variables);
mysql_mutex_lock(&LOCK_active_mi);
mi= master_info_index->
get_master_info(&thd->variables.default_master_connection,
@@ -3438,7 +3439,8 @@ bool update_multi_source_variable(sys_var *self_var, THD *thd,
mysql_mutex_unlock(&mi->rli.run_lock);
}
mysql_mutex_unlock(&LOCK_active_mi);
- mysql_mutex_lock(&LOCK_global_system_variables);
+ if (type == OPT_GLOBAL)
+ mysql_mutex_lock(&LOCK_global_system_variables);
return result;
}