summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ea0a19fc5f3..a1e8a79513d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1727,7 +1727,8 @@ void log_slow_statement(THD *thd)
/* Follow the slow log filter configuration. */
if (!thd->enable_slow_log ||
- !(thd->variables.log_slow_filter & thd->query_plan_flags))
+ (thd->variables.log_slow_filter
+ && !(thd->variables.log_slow_filter & thd->query_plan_flags)))
DBUG_VOID_RETURN;
if (((thd->server_status & SERVER_QUERY_WAS_SLOW) ||
@@ -2990,13 +2991,34 @@ end_with_restore_list:
{
LEX_MASTER_INFO* lex_mi= &thd->lex->mi;
Master_info *mi;
+ int load_error;
+
+ load_error= rpl_load_gtid_slave_state(thd);
+
mysql_mutex_lock(&LOCK_active_mi);
if ((mi= (master_info_index->
get_master_info(&lex_mi->connection_name,
MYSQL_ERROR::WARN_LEVEL_ERROR))))
+ {
+ if (load_error)
+ {
+ /*
+ We cannot start a slave using GTID if we cannot load the GTID position
+ from the mysql.gtid_slave_pos table. But we can allow non-GTID
+ replication (useful eg. during upgrade).
+ */
+ if (mi->using_gtid != Master_info::USE_GTID_NO)
+ {
+ mysql_mutex_unlock(&LOCK_active_mi);
+ break;
+ }
+ else
+ thd->clear_error();
+ }
if (!start_slave(thd, mi, 1 /* net report*/))
my_ok(thd);
+ }
mysql_mutex_unlock(&LOCK_active_mi);
break;
}