mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for a bug with empty item list in UNION's
This commit is contained in:
@ -273,3 +273,5 @@ SELECT @a:=1 UNION SELECT @a:=@a+1;
|
||||
@a:=1
|
||||
1
|
||||
2
|
||||
(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
|
||||
Unknown column 'a' in 'field list'
|
||||
|
@ -146,3 +146,5 @@ drop table t1,t2;
|
||||
(select 1) union (select 2) order by 0;
|
||||
|
||||
SELECT @a:=1 UNION SELECT @a:=@a+1;
|
||||
--error 1054
|
||||
(SELECT 1) UNION (SELECT 2) ORDER BY (SELECT a);
|
||||
|
@ -701,9 +701,10 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
(last= sl)->get_table_list(), &where,
|
||||
0)) != not_found_field)
|
||||
break;
|
||||
if ((refer= find_item_in_list(this, sl->item_list, &counter,
|
||||
if (sl->item_list.elements &&
|
||||
((refer= find_item_in_list(this, sl->item_list, &counter,
|
||||
REPORT_EXCEPT_NOT_FOUND)) !=
|
||||
(Item **)not_found_item)
|
||||
(Item **)not_found_item))
|
||||
break;
|
||||
if (sl->master_unit()->first_select()->linkage ==
|
||||
DERIVED_TABLE_TYPE)
|
||||
|
Reference in New Issue
Block a user