diff options
author | unknown <sergefp@mysql.com> | 2005-11-03 10:28:12 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-11-03 10:28:12 +0300 |
commit | 883b38a2cd31a28b87f576fe0776857873981873 (patch) | |
tree | 0ee786b29c5953b014b95552b9427e9ce4567472 /sql | |
parent | e2220f476680d60a5f35b9dcef6920862d578f80 (diff) | |
parent | 17fcbcf77290fff34a00ce1387760f5e5c71c134 (diff) | |
download | mariadb-git-883b38a2cd31a28b87f576fe0776857873981873.tar.gz |
Merged
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_lex.cc | 40 |
1 files changed, 30 insertions, 10 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 11f056d6510..a302db15736 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -2038,6 +2038,35 @@ void st_lex::cleanup_after_one_table_open() /* + Do end-of-prepare fixup for list of tables and their merge-VIEWed tables + + SYNOPSIS + fix_prepare_info_in_table_list() + thd Thread handle + tbl List of tables to process + + DESCRIPTION + Perform end-end-of prepare fixup for list of tables, if any of the tables + is a merge-algorithm VIEW, recursively fix up its underlying tables as + well. + +*/ + +static void fix_prepare_info_in_table_list(THD *thd, TABLE_LIST *tbl) +{ + for (; tbl; tbl= tbl->next_local) + { + if (tbl->on_expr) + { + tbl->prep_on_expr= tbl->on_expr; + tbl->on_expr= tbl->on_expr->copy_andor_structure(thd); + } + fix_prepare_info_in_table_list(thd, tbl->merge_underlying_list); + } +} + + +/* fix some structures at the end of preparation SYNOPSIS @@ -2056,16 +2085,7 @@ void st_select_lex::fix_prepare_information(THD *thd, Item **conds) prep_where= *conds; *conds= where= prep_where->copy_andor_structure(thd); } - for (TABLE_LIST *tbl= (TABLE_LIST *)table_list.first; - tbl; - tbl= tbl->next_local) - { - if (tbl->on_expr) - { - tbl->prep_on_expr= tbl->on_expr; - tbl->on_expr= tbl->on_expr->copy_andor_structure(thd); - } - } + fix_prepare_info_in_table_list(thd, (TABLE_LIST *)table_list.first); } } |