diff options
author | unknown <bell@sanja.is.com.ua> | 2004-04-03 11:13:51 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2004-04-03 11:13:51 +0300 |
commit | 8c8dffb60d23bf3a5666dcc251d2f15cb913d541 (patch) | |
tree | c9f3e9d74cc127bb1de122f2c0d31fab4719caac /sql/item_sum.h | |
parent | a62a5fc9c0cef8d9f1ae685b43b6dc539d6fcfc8 (diff) | |
download | mariadb-git-8c8dffb60d23bf3a5666dcc251d2f15cb913d541.tar.gz |
fixed brocken of client_test
fixed aggregate functions in PS (BUG#3360)
mysql-test/r/union.result:
4.1 more correct error
sql/item_cmpfunc.h:
and_conds do not make fix fields
sql/item_sum.cc:
storing/restoring argument of aggregate function for prepared statements
restoring order list of group_concat for safety
sql/item_sum.h:
storing/restoring argument of aggregate function for prepared statements
layout fix
sql/mysql_priv.h:
just declaration
sql/sql_base.cc:
fix_fields() have to be called with temporary memory pool active
sql/sql_parse.cc:
removed hack with item pointer storing
sql/sql_prepare.cc:
debug output added
removed hack with item pointer storing
sql/sql_select.cc:
fix_fields now should be called separately
sql/sql_union.cc:
removed wrong merged check from 4.0 (4.1 have its own protection)
sql/table.h:
removed hack with item pointer storing
tests/client_test.c:
new test fo PS
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 1c31f1a9b70..8a51a7e5a7c 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -32,40 +32,32 @@ public: UDF_SUM_FUNC, GROUP_CONCAT_FUNC }; - Item **args,*tmp_args[2]; + Item **args, *tmp_args[2]; + Item **args_copy; /* copy of arguments for PS */ uint arg_count; bool quick_group; /* If incremental update of fields */ void mark_as_sum_func(); - Item_sum() : arg_count(0),quick_group(1) + Item_sum() :args_copy(0), arg_count(0), quick_group(1) { mark_as_sum_func(); } - Item_sum(Item *a) :quick_group(1) + Item_sum(Item *a) + :args(tmp_args), args_copy(0), arg_count(1), quick_group(1) { - arg_count=1; - args=tmp_args; args[0]=a; mark_as_sum_func(); } - Item_sum( Item *a, Item *b ) :quick_group(1) + Item_sum( Item *a, Item *b ) + :args(tmp_args), args_copy(0), arg_count(2), quick_group(1) { - arg_count=2; - args=tmp_args; args[0]=a; args[1]=b; mark_as_sum_func(); } Item_sum(List<Item> &list); //Copy constructor, need to perform subselects with temporary tables Item_sum(THD *thd, Item_sum *item); - void cleanup() - { - DBUG_ENTER("Item_sum::cleanup"); - Item_result_field::cleanup(); - result_field=0; - DBUG_VOID_RETURN; - } - + void cleanup(); enum Type type() const { return SUM_FUNC_ITEM; } virtual enum Sumfunctype sum_func () const=0; inline bool reset() { clear(); return add(); }; @@ -100,6 +92,8 @@ public: virtual bool setup(THD *thd) {return 0;} virtual void make_unique() {} Item *get_tmp_table_item(THD *thd); + bool save_args_for_prepared_statements(THD *); + bool save_args(Statement* stmt); bool walk (Item_processor processor, byte *argument); }; @@ -190,7 +184,6 @@ class Item_sum_count_distinct :public Item_sum_int { TABLE *table; table_map used_table_cache; - bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); uint32 *field_lengths; TMP_TABLE_PARAM *tmp_table_param; TREE tree_base; @@ -236,7 +229,8 @@ class Item_sum_count_distinct :public Item_sum_int Item_sum_count_distinct(THD *thd, Item_sum_count_distinct *item) :Item_sum_int(thd, item), table(item->table), used_table_cache(item->used_table_cache), - field_lengths(item->field_lengths), tmp_table_param(item->tmp_table_param), + field_lengths(item->field_lengths), + tmp_table_param(item->tmp_table_param), tree(item->tree), original(item), key_length(item->key_length), max_elements_in_tree(item->max_elements_in_tree), rec_offset(item->rec_offset), use_tree(item->use_tree), |