diff options
author | bell@sanja.is.com.ua <> | 2004-02-18 01:08:52 +0200 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-02-18 01:08:52 +0200 |
commit | 14b9fa3588a35c8e7df3961eba06e6e590eabfcf (patch) | |
tree | 65aff983542f7b988996319163a7a3e003e845f4 /sql/item_sum.cc | |
parent | 8a865250c4180ee197c4626560eb46c2cea0a696 (diff) | |
download | mariadb-git-14b9fa3588a35c8e7df3961eba06e6e590eabfcf.tar.gz |
revision of fix_fields() calls (BUG2838)
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 10b50fa5b3b..762c2df6cf7 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; |