diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-04 16:46:58 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-04 16:46:58 +0200 |
commit | 9835f7b80fc0eaa7fe4969ae87ae1bfbcc7aa157 (patch) | |
tree | 8c12732d7d80790d1f70ed5e302398600b733186 /sql/sql_lex.cc | |
parent | 74d648db12e100c628548fb2e5aa67de718bd1fb (diff) | |
parent | 91e4f00389483d22fa81517bbcdcd21499fd283a (diff) | |
download | mariadb-git-9835f7b80fc0eaa7fe4969ae87ae1bfbcc7aa157.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r-- | sql/sql_lex.cc | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 869d990ed6e..399e189a8d0 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2132,7 +2132,7 @@ void st_select_lex::init_query() hidden_bit_fields= 0; subquery_in_having= explicit_limit= 0; is_item_list_lookup= 0; - first_execution= 1; + changed_elements= 0; first_natural_join_processing= 1; first_cond_optimization= 1; parsing_place= NO_MATTER; @@ -3661,9 +3661,10 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds, Item **having_conds) { DBUG_ENTER("st_select_lex::fix_prepare_information"); - if (!thd->stmt_arena->is_conventional() && first_execution) + if (!thd->stmt_arena->is_conventional() && + !(changed_elements & TOUCHED_SEL_COND)) { - first_execution= 0; + changed_elements|= TOUCHED_SEL_COND; if (group_list.first) { if (!group_list_ptrs) @@ -3914,14 +3915,7 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only) bool st_select_lex::handle_derived(LEX *lex, uint phases) { - for (TABLE_LIST *cursor= (TABLE_LIST*) table_list.first; - cursor; - cursor= cursor->next_local) - { - if (cursor->is_view_or_derived() && cursor->handle_derived(lex, phases)) - return TRUE; - } - return FALSE; + return lex->handle_list_of_derived(table_list.first, phases); } @@ -4843,6 +4837,20 @@ bool LEX::is_partition_management() const alter_info.flags == Alter_info::ALTER_REORGANIZE_PARTITION)); } + +bool Sql_cmd::log_slow_enabled_statement(const THD *thd) const +{ + return global_system_variables.sql_log_slow && thd->variables.sql_log_slow; +} + + +bool Sql_cmd_admin::log_slow_enabled_statement(const THD *thd) const +{ + return opt_log_slow_admin_statements && + Sql_cmd::log_slow_enabled_statement(thd); +} + + #ifdef MYSQL_SERVER uint binlog_unsafe_map[256]; |