summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-08-15 23:18:36 -0700
committerIgor Babaev <igor@askmonty.org>2011-08-15 23:18:36 -0700
commitbe03fe9c29b1622ea3d1ee6f47c5826d09529a61 (patch)
tree2c55e0a093c417f3e952744b3a79c2ac266792fc /sql/sql_lex.h
parentfb135f7ee570a199d78db7c3222db1980b75060f (diff)
downloadmariadb-git-be03fe9c29b1622ea3d1ee6f47c5826d09529a61.tar.gz
Fixed LP bug #824463.
When merging a view / derived table the function SELECT_LEX::merge_subquery incorrectly updated the list SELECT_LEX::leaf_tables. Erroneously it appended the leaf_tables list of the merged object L and then removed the reference to the merged object T from the SELECT_LEX::leaf_tables list. A correct implementation should insert the list L into the SELECT_LEX::leaf_tables list in place of the element of the list that refers to T. The bug could lead to wrong results or even crashes for queries with nested outer joins over views / derived tables.
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index fe79e6e2908..0da628b7ca0 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -888,7 +888,7 @@ public:
bool handle_derived(struct st_lex *lex, uint phases);
void append_table_to_list(TABLE_LIST *TABLE_LIST::*link, TABLE_LIST *table);
bool get_free_table_map(table_map *map, uint *tablenr);
- void remove_table_from_list(TABLE_LIST *table);
+ void replace_leaf_table(TABLE_LIST *table, List<TABLE_LIST> &tbl_list);
void remap_tables(TABLE_LIST *derived, table_map map,
uint tablenr, st_select_lex *parent_lex);
bool merge_subquery(THD *thd, TABLE_LIST *derived, st_select_lex *subq_lex,