1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#14026: When doing the end-of-prepare fix up for TABLE_LISTs used in the PS, do the fixup

for underlying tables of a merge VIEWs, too.
This commit is contained in:
sergefp@mysql.com
2005-11-02 07:05:19 +03:00
parent 3612707c71
commit 96ff1e808a
3 changed files with 75 additions and 12 deletions

View File

@ -2037,6 +2037,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
@ -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);
}
}