mirror of
https://github.com/MariaDB/server.git
synced 2026-05-14 19:07:15 +02:00
Merge host.loc:/home/uchum/work/PA/5.0-opt-34763
into host.loc:/home/uchum/work/5.0-opt sql/item.cc: Auto merged
This commit is contained in:
commit
070a233415
4 changed files with 49 additions and 10 deletions
15
sql/item.cc
15
sql/item.cc
|
|
@ -5481,13 +5481,16 @@ bool Item_ref::fix_fields(THD *thd, Item **reference)
|
|||
DBUG_ASSERT(*ref);
|
||||
/*
|
||||
Check if this is an incorrect reference in a group function or forward
|
||||
reference. Do not issue an error if this is an unnamed reference inside an
|
||||
aggregate function.
|
||||
reference. Do not issue an error if this is:
|
||||
1. outer reference (will be fixed later by the fix_inner_refs function);
|
||||
2. an unnamed reference inside an aggregate function.
|
||||
*/
|
||||
if (((*ref)->with_sum_func && name &&
|
||||
!(current_sel->linkage != GLOBAL_OPTIONS_TYPE &&
|
||||
current_sel->having_fix_field)) ||
|
||||
!(*ref)->fixed)
|
||||
if (!((*ref)->type() == REF_ITEM &&
|
||||
((Item_ref *)(*ref))->ref_type() == OUTER_REF) &&
|
||||
(((*ref)->with_sum_func && name &&
|
||||
!(current_sel->linkage != GLOBAL_OPTIONS_TYPE &&
|
||||
current_sel->having_fix_field)) ||
|
||||
!(*ref)->fixed))
|
||||
{
|
||||
my_error(ER_ILLEGAL_REFERENCE, MYF(0),
|
||||
name, ((*ref)->with_sum_func?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue