summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-03-01 15:52:06 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-03-01 15:52:06 +0100
commitf2e1451740d417f1c9ea8626d937fbcacc91bb55 (patch)
treecd915badee79727c047208a7804181543cdb9c27 /sql/sql_lex.cc
parente39d6e0c53bccaf0c6b2a0341f8deb420f5e79be (diff)
parent2d34713294d5339d1459911a46fa20395443b3c7 (diff)
downloadmariadb-git-f2e1451740d417f1c9ea8626d937fbcacc91bb55.tar.gz
Merge branch '10.0' into 10.1
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 09f8eb650de..c5aaa8e3cca 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2127,7 +2127,7 @@ void st_select_lex::init_query()
n_child_sum_items= 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;
@@ -3597,9 +3597,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)
@@ -3850,14 +3851,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);
}