Commit 9e4848c2 authored by unknown's avatar unknown

A fix for a bug reported by Per Erik Martin, partaining to

usage of expressions whose result are to be saved into user vars.

parent 6da897e0
...@@ -1192,7 +1192,16 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) ...@@ -1192,7 +1192,16 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
} }
} }
if (((*ref)->with_sum_func && /*
* The following conditional is changed as to correctly identify
* incorrect references in group functions or forward references
* with sub-select's / derived tables, while it prevents this
* check when Item_ref is created in an expression involving
* summing function, which is to be placed in the user variable.
*
*/
if (((*ref)->with_sum_func && name &&
(depended_from || (depended_from ||
!(thd->lex.current_select->linkage != GLOBAL_OPTIONS_TYPE && !(thd->lex.current_select->linkage != GLOBAL_OPTIONS_TYPE &&
thd->lex.current_select->select_lex()->having_fix_field))) || thd->lex.current_select->select_lex()->having_fix_field))) ||
......
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