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

Fix of LP bug#968720.

When a view/derived table is converted from merged to materialized the
items from the used_item lists are substituted for items referring to
the fields of the result of the materialization. The problem appeared
with queries employing natural joins. Since the resolution of a natural
join was performed only once the used_item list formed at the second
execution of the query lacked the references to the fields that were
used only in the equality predicates generated for the natural join.
This commit is contained in:
unknown
2012-04-05 23:32:57 +03:00
parent cc2298ebb7
commit 1a48919036
6 changed files with 131 additions and 3 deletions

View File

@ -7276,6 +7276,14 @@ mark_common_columns(THD *thd, TABLE_LIST *table_ref_1, TABLE_LIST *table_ref_2,
*/
result= FALSE;
/*
Save the lists made during natural join matching (because
the matching done only once but we need the list in case
of prepared statements).
*/
table_ref_1->persistent_used_items= table_ref_1->used_items;
table_ref_2->persistent_used_items= table_ref_2->used_items;
err:
if (arena)
thd->restore_active_arena(arena, &backup);