diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_subselect.cc | 2 | ||||
-rw-r--r-- | sql/rpl_rli.cc | 8 | ||||
-rw-r--r-- | sql/signal_handler.cc | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 8 | ||||
-rw-r--r-- | sql/sql_repl.cc | 8 | ||||
-rw-r--r-- | sql/sql_show.cc | 40 |
7 files changed, 43 insertions, 31 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 640ed311602..92a86063d04 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2038,7 +2038,7 @@ bool Item_allany_subselect::transform_into_max_min(JOIN *join) The swap is needed for expressions of type 'f1 < ALL ( SELECT ....)' where we want to evaluate the sub query even if f1 would be null. */ - subs= func->create_swap(thd, *(optimizer->get_cache()), subs); + subs= func->create_swap(thd, expr, subs); thd->change_item_tree(place, subs); if (subs->fix_fields(thd, &subs)) DBUG_RETURN(true); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 7215cdd4b96..99f8da2c928 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2006, 2017, Oracle and/or its affiliates. - Copyright (c) 2010, 2017, MariaDB Corporation + Copyright (c) 2010, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1467,8 +1467,14 @@ bool Relay_log_info::stmt_done(my_off_t event_master_log_pos, THD *thd, } DBUG_EXECUTE_IF("inject_crash_before_flush_rli", DBUG_SUICIDE();); if (mi->using_gtid == Master_info::USE_GTID_NO) + { + if (rgi->is_parallel_exec) + mysql_mutex_lock(&data_lock); if (flush()) error= 1; + if (rgi->is_parallel_exec) + mysql_mutex_unlock(&data_lock); + } DBUG_EXECUTE_IF("inject_crash_after_flush_rli", DBUG_SUICIDE();); } DBUG_RETURN(error); diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index c20f9920b7e..c913a0477d7 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -277,7 +277,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) } my_safe_printf_stderr("%s", "The manual page at " - "http://dev.mysql.com/doc/mysql/en/crashing.html contains\n" + "https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains\n" "information that should help you find out what is causing the crash.\n"); #endif /* HAVE_STACKTRACE */ diff --git a/sql/sql_class.h b/sql/sql_class.h index 838998af94f..1e4f0225397 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3610,11 +3610,7 @@ public: bool is_bulk_op() const { return MY_TEST(bulk_param); } /// Returns Diagnostics-area for the current statement. - Diagnostics_area *get_stmt_da() - { return m_stmt_da; } - - /// Returns Diagnostics-area for the current statement. - const Diagnostics_area *get_stmt_da() const + Diagnostics_area *get_stmt_da() const { return m_stmt_da; } /// Sets Diagnostics-area for the current statement. diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f1c9479adc7..66433d11d8f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -913,11 +913,6 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, char *buf= thd->strmake(init_command->str, len); mysql_rwlock_unlock(var_lock); -#if defined(ENABLED_PROFILING) - thd->profiling.start_new_query(); - thd->profiling.set_query_source(buf, len); -#endif - THD_STAGE_INFO(thd, stage_execution_of_init_command); save_client_capabilities= thd->client_capabilities; thd->client_capabilities|= CLIENT_MULTI_QUERIES; @@ -932,9 +927,6 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, thd->client_capabilities= save_client_capabilities; thd->net.vio= save_vio; -#if defined(ENABLED_PROFILING) - thd->profiling.finish_current_query(); -#endif } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index a1ff4affd50..721b6799ed3 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2038,9 +2038,13 @@ static int init_binlog_sender(binlog_send_info *info, }); if (global_system_variables.log_warnings > 1) + { sql_print_information( - "Start binlog_dump to slave_server(%lu), pos(%s, %lu)", - thd->variables.server_id, log_ident, (ulong)*pos); + "Start binlog_dump to slave_server(%lu), pos(%s, %lu), " + "using_gtid(%d), gtid('%s')", thd->variables.server_id, + log_ident, (ulong)*pos, info->using_gtid_state, + connect_gtid_state.c_ptr_quick()); + } #ifndef DBUG_OFF if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4e37b53b87e..205b9facc7f 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5079,6 +5079,29 @@ bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name, } +/* + Check if the specified database exists on disk. + + @param dbname - the database name + @retval true - on error, the database directory does not exists + @retval false - on success, the database directory exists +*/ +static bool verify_database_directory_exists(const LEX_STRING &dbname) +{ + DBUG_ENTER("verity_database_exists"); + char path[FN_REFLEN + 16]; + uint path_len; + MY_STAT stat_info; + if (!dbname.str[0]) + DBUG_RETURN(true); // Empty database name: does not exits. + path_len= build_table_filename(path, sizeof(path) - 1, dbname.str, "", "", 0); + path[path_len - 1]= 0; + if (!mysql_file_stat(key_file_misc, path, &stat_info, MYF(0))) + DBUG_RETURN(true); // The database directory was not found: does not exists. + DBUG_RETURN(false); // The database directory was found. +} + + int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) { /* @@ -5107,19 +5130,10 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) If we have lookup db value we should check that the database exists */ if(lookup_field_vals.db_value.str && !lookup_field_vals.wild_db_value && - db_names.at(0) != &INFORMATION_SCHEMA_NAME) - { - char path[FN_REFLEN+16]; - uint path_len; - MY_STAT stat_info; - if (!lookup_field_vals.db_value.str[0]) - DBUG_RETURN(0); - path_len= build_table_filename(path, sizeof(path) - 1, - lookup_field_vals.db_value.str, "", "", 0); - path[path_len-1]= 0; - if (!mysql_file_stat(key_file_misc, path, &stat_info, MYF(0))) - DBUG_RETURN(0); - } + (!db_names.elements() /* The database name was too long */|| + (db_names.at(0) != &INFORMATION_SCHEMA_NAME && + verify_database_directory_exists(lookup_field_vals.db_value)))) + DBUG_RETURN(0); for (size_t i=0; i < db_names.elements(); i++) { |