Skip to content

Commit

Permalink
Code cleanup: merge walk_items_for_table_list with walk_table_functio…
Browse files Browse the repository at this point in the history
…ns_for_list
  • Loading branch information
spetrunia committed Apr 21, 2021
1 parent 4930f9c commit dd6ad38
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions sql/item_subselect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,12 @@ bool Item_subselect::is_expensive()
}


/*
@brief
Apply item processor for all scalar (i.e. Item*) expressions that
occur in the nested join.
*/

static
int walk_items_for_table_list(Item_processor processor,
bool walk_subquery, void *argument,
Expand All @@ -699,6 +705,14 @@ int walk_items_for_table_list(Item_processor processor,
if ((res= table->on_expr->walk(processor, walk_subquery, argument)))
return res;
}
if (Table_function_json_table *tf= table->table_function)
{
if ((res= tf->walk_items(processor, walk_subquery, argument)))
{
return res;
}
}

if (table->nested_join)
{
if ((res= walk_items_for_table_list(processor, walk_subquery, argument,
Expand Down Expand Up @@ -807,10 +821,6 @@ bool Item_subselect::walk(Item_processor processor, bool walk_subquery,
*lex->join_list))
return 1;

if (walk_table_functions_for_list(processor, walk_subquery, argument,
*lex->join_list))
return 1;

while (Item *item= li++)
{
if (item->walk(processor, walk_subquery, argument))
Expand Down

0 comments on commit dd6ad38

Please sign in to comment.