From ae7eec928c86014f7eef3e48fa28196cf999434c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Feb 2004 01:08:52 +0200 Subject: revision of fix_fields() calls (BUG2838) mysql-test/r/subselect.result: test suite for BUG#2838 mysql-test/t/subselect.test: test suite for BUG#2838 sql/item.cc: revision of fix_fields() calls removed unnecessary variabl, and used correct last parameter of fix_fields() sql/item_cmpfunc.cc: revision of fix_fields() calls (BUG#2838) sql/item_func.cc: revision of fix_fields() calls sql/item_row.cc: changed for efficience (and to be similar for Item_func::fix_fields) sql/item_subselect.cc: fixed last arguments for fix_fields call sql/item_sum.cc: layout fixed revision of fix_fields() calls sql/log_event.cc: revision of fix_fields() calls sql/set_var.cc: revision of fix_fields() calls sql/sql_base.cc: revision of fix_fields() calls sql/sql_class.cc: revision of fix_fields() calls sql/sql_handler.cc: revision of fix_fields() calls --- sql/item_sum.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sql/item_sum.cc') 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; -- cgit v1.2.1