revision-id: dd6ad3806856221f1af302e61ebd985905a00060 (mariadb-10.5.2-640-gdd6ad380685) parent(s): 4930f9c94bb610f4d76b73a8b6b351d9fa9c5d68 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2021-04-21 12:32:58 +0300 message: Code cleanup: merge walk_items_for_table_list with walk_table_functions_for_list --- sql/item_subselect.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index c9afc9c1bcd..3f60203387a 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -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, @@ -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, @@ -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))