diff options
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 58aa7de073f..de67a314631 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -275,11 +275,11 @@ bool Item_subselect::const_item() const return const_item_cache; } -Item *Item_subselect::get_tmp_table_item(THD *thd) +Item *Item_subselect::get_tmp_table_item(THD *thd_arg) { if (!with_sum_func && !const_item()) return new Item_field(result_field); - return copy_or_same(thd); + return copy_or_same(thd_arg); } void Item_subselect::update_used_tables() @@ -594,13 +594,13 @@ void Item_exists_subselect::print(String *str) } -bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit) +bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit_arg) { - if (unit->fake_select_lex && - unit->fake_select_lex->test_limit()) + if (unit_arg->fake_select_lex && + unit_arg->fake_select_lex->test_limit()) return(1); - SELECT_LEX *sl= unit->first_select(); + SELECT_LEX *sl= unit_arg->first_select(); for (; sl; sl= sl->next_select()) { if (sl->test_limit()) @@ -872,7 +872,6 @@ Item_subselect::trans_res Item_in_subselect::single_value_transformer(JOIN *join, Comp_creator *func) { - Item_subselect::trans_res result= RES_ERROR; SELECT_LEX *select_lex= join->select_lex; DBUG_ENTER("Item_in_subselect::single_value_transformer"); @@ -970,7 +969,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, if (!substitution) { /* We're invoked for the 1st (or the only) SELECT in the subquery UNION */ - SELECT_LEX_UNIT *unit= select_lex->master_unit(); + SELECT_LEX_UNIT *master_unit= select_lex->master_unit(); substitution= optimizer; SELECT_LEX *current= thd->lex->current_select, *up; @@ -993,7 +992,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, (char *)"<no matter>", (char *)in_left_expr_name); - unit->uncacheable|= UNCACHEABLE_DEPENDENT; + master_unit->uncacheable|= UNCACHEABLE_DEPENDENT; } if (!abort_on_null && left_expr->maybe_null && !pushed_cond_guards) { @@ -1192,7 +1191,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) if (!substitution) { //first call for this unit - SELECT_LEX_UNIT *unit= select_lex->master_unit(); + SELECT_LEX_UNIT *master_unit= select_lex->master_unit(); substitution= optimizer; SELECT_LEX *current= thd->lex->current_select, *up; @@ -1208,7 +1207,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) optimizer->keep_top_level_cache(); thd->lex->current_select= current; - unit->uncacheable|= UNCACHEABLE_DEPENDENT; + master_unit->uncacheable|= UNCACHEABLE_DEPENDENT; if (!abort_on_null && left_expr->maybe_null && !pushed_cond_guards) { @@ -1241,7 +1240,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) { DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed); if (select_lex->ref_pointer_array[i]-> - check_cols(left_expr->el(i)->cols())) + check_cols(left_expr->element_index(i)->cols())) DBUG_RETURN(RES_ERROR); Item *item_eq= new Item_func_eq(new @@ -1264,7 +1263,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) (char *)"<list ref>") ); Item *col_item= new Item_cond_or(item_eq, item_isnull); - if (!abort_on_null && left_expr->el(i)->maybe_null) + if (!abort_on_null && left_expr->element_index(i)->maybe_null) { if (!(col_item= new Item_func_trig_cond(col_item, get_cond_guard(i)))) DBUG_RETURN(RES_ERROR); @@ -1278,7 +1277,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) ref_pointer_array + i, (char *)"<no matter>", (char *)"<list ref>")); - if (!abort_on_null && left_expr->el(i)->maybe_null) + if (!abort_on_null && left_expr->element_index(i)->maybe_null) { if (!(item_nnull_test= new Item_func_trig_cond(item_nnull_test, get_cond_guard(i)))) @@ -1315,7 +1314,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) Item *item, *item_isnull; DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed); if (select_lex->ref_pointer_array[i]-> - check_cols(left_expr->el(i)->cols())) + check_cols(left_expr->element_index(i)->cols())) DBUG_RETURN(RES_ERROR); item= new Item_func_eq(new @@ -1355,7 +1354,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) TODO: why we create the above for cases where the right part cant be NULL? */ - if (left_expr->el(i)->maybe_null) + if (left_expr->element_index(i)->maybe_null) { if (!(item= new Item_func_trig_cond(item, get_cond_guard(i)))) DBUG_RETURN(RES_ERROR); @@ -1517,14 +1516,14 @@ void Item_in_subselect::print(String *str) } -bool Item_in_subselect::fix_fields(THD *thd, Item **ref) +bool Item_in_subselect::fix_fields(THD *thd_arg, Item **ref) { bool result = 0; - if(thd->lex->view_prepare_mode && left_expr && !left_expr->fixed) - result = left_expr->fix_fields(thd, &left_expr); + if (thd_arg->lex->view_prepare_mode && left_expr && !left_expr->fixed) + result = left_expr->fix_fields(thd_arg, &left_expr); - return result || Item_subselect::fix_fields(thd, ref); + return result || Item_subselect::fix_fields(thd_arg, ref); } @@ -1563,13 +1562,13 @@ void subselect_engine::set_thd(THD *thd_arg) subselect_single_select_engine:: subselect_single_select_engine(st_select_lex *select, - select_subselect *result, - Item_subselect *item) - :subselect_engine(item, result), + select_subselect *result_arg, + Item_subselect *item_arg) + :subselect_engine(item_arg, result_arg), prepared(0), optimized(0), executed(0), select_lex(select), join(0) { - select_lex->master_unit()->item= item; + select_lex->master_unit()->item= item_arg; } @@ -1806,7 +1805,6 @@ int subselect_single_select_engine::exec() if (!executed) { item->reset_value_registration(); - bool have_changed_access= FALSE; JOIN_TAB *changed_tabs[MAX_TABLES]; JOIN_TAB **last_changed_tab= changed_tabs; if (item->have_guarded_conds()) |