summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-06-05 10:50:08 +0400
committerAlexander Barkov <bar@mariadb.com>2018-06-05 10:50:08 +0400
commitab297744b7318645159cd5f9ec26378473cecf52 (patch)
tree28df98886259f9df535b84deff18a89e08064e58 /sql/opt_subselect.cc
parent8760acdda88cc5ead925024bc47df4d27f911bb0 (diff)
parent106f0b5798a2b5d13b7d67c3cc678fc0cc2184c2 (diff)
downloadmariadb-git-ab297744b7318645159cd5f9ec26378473cecf52.tar.gz
Merge remote-tracking branch 'origin/10.3' into 10.4
Diffstat (limited to 'sql/opt_subselect.cc')
-rw-r--r--sql/opt_subselect.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc
index 800ee65fe26..7f7bb07d279 100644
--- a/sql/opt_subselect.cc
+++ b/sql/opt_subselect.cc
@@ -620,8 +620,8 @@ int check_and_do_in_subquery_rewrites(JOIN *join)
char const *save_where= thd->where;
thd->where= "IN/ALL/ANY subquery";
- bool failure= !in_subs->left_expr->fixed &&
- in_subs->left_expr->fix_fields(thd, &in_subs->left_expr);
+ bool failure= in_subs->left_expr->fix_fields_if_needed(thd,
+ &in_subs->left_expr);
thd->lex->current_select= current;
thd->where= save_where;
if (failure)
@@ -1666,8 +1666,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
*/
SELECT_LEX *save_lex= thd->lex->current_select;
thd->lex->current_select=subq_lex;
- if (!subq_pred->left_expr->fixed &&
- subq_pred->left_expr->fix_fields(thd, &subq_pred->left_expr))
+ if (subq_pred->left_expr->fix_fields_if_needed(thd, &subq_pred->left_expr))
DBUG_RETURN(TRUE);
thd->lex->current_select=save_lex;
@@ -1777,8 +1776,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
to check for this at name resolution stage, but as a legacy of IN->EXISTS
we have in here).
*/
- if (!sj_nest->sj_on_expr->fixed &&
- sj_nest->sj_on_expr->fix_fields(thd, &sj_nest->sj_on_expr))
+ if (sj_nest->sj_on_expr->fix_fields_if_needed(thd, &sj_nest->sj_on_expr))
{
DBUG_RETURN(TRUE);
}
@@ -1804,9 +1802,8 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
emb_tbl_nest->on_expr= and_items(thd, emb_tbl_nest->on_expr,
sj_nest->sj_on_expr);
emb_tbl_nest->on_expr->top_level_item();
- if (!emb_tbl_nest->on_expr->fixed &&
- emb_tbl_nest->on_expr->fix_fields(thd,
- &emb_tbl_nest->on_expr))
+ if (emb_tbl_nest->on_expr->fix_fields_if_needed(thd,
+ &emb_tbl_nest->on_expr))
{
DBUG_RETURN(TRUE);
}
@@ -1822,9 +1819,7 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred)
*/
save_lex= thd->lex->current_select;
thd->lex->current_select=parent_join->select_lex;
- if (!parent_join->conds->fixed &&
- parent_join->conds->fix_fields(thd,
- &parent_join->conds))
+ if (parent_join->conds->fix_fields_if_needed(thd, &parent_join->conds))
{
DBUG_RETURN(1);
}
@@ -3724,7 +3719,7 @@ bool setup_sj_materialization_part1(JOIN_TAB *sjm_tab)
re-executing it will not be prepared. To use the Items from its
select list we have to prepare (fix_fields) them
*/
- if (!item->fixed && item->fix_fields(thd, it.ref()))
+ if (item->fix_fields_if_needed(thd, it.ref()))
DBUG_RETURN(TRUE);
item= *(it.ref()); // it can be changed by fix_fields
DBUG_ASSERT(!item->name.length || item->name.length == strlen(item->name.str));
@@ -5587,7 +5582,7 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond,
li.rewind();
while ((item=li++))
{
- if (!item->fixed && item->fix_fields(thd, NULL))
+ if (item->fix_fields_if_needed(thd, NULL))
return NULL;
if (item->const_item() && !item->val_int())
is_simplified_cond= true;
@@ -5648,7 +5643,7 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond,
cond= iter++;
}
- if (!cond->fixed && cond->fix_fields(thd, NULL))
+ if (cond->fix_fields_if_needed(thd, NULL))
return NULL;
if (new_cond_equal.current_level.elements > 0)