summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2003-04-08 15:55:28 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2003-04-08 15:55:28 +0300
commitf4216c526bcd7b3e68249f4349f856a8dfcc7f73 (patch)
tree61cdb9d344cfba9a8aed03452467feade323e11e /sql/item.cc
parenteaa27ad448168ea262d925b828ecc7425dbfe724 (diff)
downloadmariadb-git-f4216c526bcd7b3e68249f4349f856a8dfcc7f73.tar.gz
Fix for a bug with empty item list in UNION's
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 30f610ea92a..a029219c366 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -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,
- REPORT_EXCEPT_NOT_FOUND)) !=
- (Item **)not_found_item)
+ if (sl->item_list.elements &&
+ ((refer= find_item_in_list(this, sl->item_list, &counter,
+ REPORT_EXCEPT_NOT_FOUND)) !=
+ (Item **)not_found_item))
break;
if (sl->master_unit()->first_select()->linkage ==
DERIVED_TABLE_TYPE)