summaryrefslogtreecommitdiff
path: root/sql/item_sum.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-03-09 12:52:25 +0200
committerunknown <bell@sanja.is.com.ua>2004-03-09 12:52:25 +0200
commitd68e1032369189dd869d69dbced8d493ce52fd77 (patch)
treed3c1e37bae62a884fc201f284f48cd2d27f05630 /sql/item_sum.cc
parent53d4a5661b0ee2c4184f8d74cc0477bdb9ff4d2d (diff)
parent83e693021536b29dede64dbe58a660f5f0458599 (diff)
downloadmariadb-git-d68e1032369189dd869d69dbced8d493ce52fd77.tar.gz
merge
mysql-test/r/subselect.result: Auto merged mysql-test/t/subselect.test: Auto merged sql/item.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r--sql/item_sum.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 879c5f99ebd..77a910ae5d6 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -191,17 +191,21 @@ Item_sum_num::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
bool
Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
- Item *item=args[0];
+ Item *item= args[0];
if (!thd->allow_sum_func)
{
my_error(ER_INVALID_GROUP_FUNC_USE,MYF(0));
return 1;
}
thd->allow_sum_func=0; // No included group funcs
+
+ // 'item' can be changed during fix_fields
if (!item->fixed &&
- item->fix_fields(thd, tables, args) || item->check_cols(1))
+ item->fix_fields(thd, tables, args) ||
+ (item= args[0])->check_cols(1))
return 1;
- hybrid_type=item->result_type();
+
+ hybrid_type= item->result_type();
if (hybrid_type == INT_RESULT)
{
cmp_charset= &my_charset_bin;