diff options
author | unknown <bell@sanja.is.com.ua> | 2002-07-01 14:14:51 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2002-07-01 14:14:51 +0300 |
commit | e5b5f45319a9fe1c90710e49faecc6a33eeac486 (patch) | |
tree | df426008e76b78f3cb8ff349e13e07746cb6f44f /sql/item_sum.cc | |
parent | 969919146e96f7709f32ac882359372a45da7944 (diff) | |
download | mariadb-git-e5b5f45319a9fe1c90710e49faecc6a33eeac486.tar.gz |
subselect in having clause
fixed bug in sum function in subselect
mysql-test/r/subselect.result:
subselect in having clause
mysql-test/t/subselect.test:
subselect in having clause
sql/item.cc:
subselect in having clause
sql/item.h:
subselect in having clause
sql/item_cmpfunc.cc:
subselect in having clause
sql/item_cmpfunc.h:
subselect in having clause
sql/item_func.cc:
subselect in having clause
sql/item_func.h:
subselect in having clause
sql/item_strfunc.h:
subselect in having clause
sql/item_subselect.cc:
subselect in having clause
sql/item_subselect.h:
subselect in having clause
sql/item_uniq.h:
subselect in having clause
sql/sql_base.cc:
subselect in having clause
sql/sql_class.cc:
subselect in having clause
sql/sql_class.h:
subselect in having clause
sql/sql_handler.cc:
subselect in having clause
sql/sql_lex.cc:
subselect in having clause
sql/sql_lex.h:
subselect in having clause
sql/sql_prepare.cc:
subselect in having clause
sql/sql_yacc.yy:
subselect in having clause
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 6ef968c33f7..809dd65d52b 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -112,7 +112,7 @@ Item_sum_int::val_str(String *str) bool -Item_sum_num::fix_fields(THD *thd,TABLE_LIST *tables) +Item_sum_num::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { if (!thd->allow_sum_func) { @@ -124,7 +124,7 @@ Item_sum_num::fix_fields(THD *thd,TABLE_LIST *tables) maybe_null=0; for (uint i=0 ; i < arg_count ; i++) { - if (args[i]->fix_fields(thd,tables)) + if (args[i]->fix_fields(thd, tables, args + i)) return 1; if (decimals < args[i]->decimals) decimals=args[i]->decimals; @@ -140,7 +140,7 @@ Item_sum_num::fix_fields(THD *thd,TABLE_LIST *tables) bool -Item_sum_hybrid::fix_fields(THD *thd,TABLE_LIST *tables) +Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { Item *item=args[0]; if (!thd->allow_sum_func) @@ -149,7 +149,7 @@ Item_sum_hybrid::fix_fields(THD *thd,TABLE_LIST *tables) return 1; } thd->allow_sum_func=0; // No included group funcs - if (item->fix_fields(thd,tables)) + if (item->fix_fields(thd, tables, args)) return 1; hybrid_type=item->result_type(); if (hybrid_type == INT_RESULT) @@ -930,9 +930,10 @@ Item_sum_count_distinct::~Item_sum_count_distinct() } -bool Item_sum_count_distinct::fix_fields(THD *thd,TABLE_LIST *tables) +bool Item_sum_count_distinct::fix_fields(THD *thd, TABLE_LIST *tables, + Item **ref) { - if (Item_sum_num::fix_fields(thd,tables) || + if (Item_sum_num::fix_fields(thd, tables, ref) || !(tmp_table_param= new TMP_TABLE_PARAM)) return 1; return 0; |