Commit 4e206330 authored by unknown's avatar unknown

fix for a bug with UNION in sub-select's and start working on

UNION's in derived tables

parent 89524b29
......@@ -201,3 +201,6 @@ set SQL_SELECT_LIMIT=DEFAULT;
drop table t1,t2;
select * union select 1;
No tables used
select 1 as a,(select a union select a);
a (select a union select a)
1 1
......@@ -103,3 +103,4 @@ drop table t1,t2;
--error 1096
select * union select 1;
select 1 as a,(select a union select a);
......@@ -125,6 +125,8 @@ int st_select_lex_unit::prepare(THD *thd, select_result *result)
SELECT_LEX_NODE *lex_select_save= thd->lex.current_select;
SELECT_LEX *sl;
if (lex_select_save->linkage != DERIVED_TABLE_TYPE)
thd->lex.current_select=first_select();
/* Global option */
if (((void*)(global_parameters)) == ((void*)this))
{
......
......@@ -2504,7 +2504,7 @@ select_derived:
mysql_init_select(lex);
lex->current_select->linkage= DERIVED_TABLE_TYPE;
}
select_options select_item_list opt_select_from
select_options select_item_list opt_select_from union_opt
;
opt_outer:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment