From c3b49a4e6ad53caba5c3c42caa84e763021be69a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Dec 2003 14:08:19 +0400 Subject: Fix for prepared statements Here i added Item_*::cleanup() functions, removed a lot of ~Item_*'s, added code to restore order_list and group_list sql/item.cc: cleanups methods implemented Item_ref constructors changed sql/item.h: cleanups declared Item_ref constructors changed some ~Item_* deleted sql/item_cmpfunc.cc: new Item_ref format sql/item_cmpfunc.h: saving/restoring of the original arguments added to eq and equal functions sql/item_func.cc: New Item_ref format sql/item_func.h: destructors removed/changed to 'cleanup()' sql/item_row.cc: New Item_ref format sql/item_row.h: ~Item_row -> cleanup() sql/item_strfunc.cc: new Item_ref format sql/item_strfunc.h: destructors removed sql/item_subselect.cc: Item_subselect implementation, new Item_ref() format sql/item_subselect.h: cleanups for subselects declared sql/item_sum.cc: cleanups implementations sql/item_sum.h: cleanups declarations destructors removed sql/mysql_priv.h: free_items, cleanup_items exported sql/sql_prepare.cc: cleanup_items, free_items calls added stmt->query_id= thd->query_id restored cleanup procedures for group_list and order_list added sql/sql_yacc.yy: New Item_ref() format --- sql/item_sum.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'sql/item_sum.h') diff --git a/sql/item_sum.h b/sql/item_sum.h index 8065218df97..dd180d42011 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -58,7 +58,11 @@ public: Item_sum(List &list); //Copy constructor, need to perform subselects with temporary tables Item_sum(THD *thd, Item_sum &item); - ~Item_sum() { result_field=0; } + void cleanup() + { + Item_result_field::cleanup(); + result_field=0; + } enum Type type() const { return SUM_FUNC_ITEM; } virtual enum Sumfunctype sum_func () const=0; @@ -235,7 +239,7 @@ class Item_sum_count_distinct :public Item_sum_int rec_offset(item.rec_offset), use_tree(item.use_tree), always_null(item.always_null) {} - ~Item_sum_count_distinct(); + void cleanup(); table_map used_tables() const { return used_table_cache; } enum Sumfunctype sum_func () const { return COUNT_DISTINCT_FUNC; } @@ -523,7 +527,6 @@ public: { quick_group=0;} Item_udf_sum(THD *thd, Item_udf_sum &item) :Item_sum(thd, item), udf(item.udf) {} - ~Item_udf_sum() {} const char *func_name() const { return udf.name(); } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { @@ -548,7 +551,6 @@ class Item_sum_udf_float :public Item_udf_sum :Item_udf_sum(udf_arg,list) {} Item_sum_udf_float(THD *thd, Item_sum_udf_float &item) :Item_udf_sum(thd, item) {} - ~Item_sum_udf_float() {} longlong val_int() { return (longlong) Item_sum_udf_float::val(); } double val(); String *val_str(String*str); @@ -565,7 +567,6 @@ public: :Item_udf_sum(udf_arg,list) {} Item_sum_udf_int(THD *thd, Item_sum_udf_int &item) :Item_udf_sum(thd, item) {} - ~Item_sum_udf_int() {} longlong val_int(); double val() { return (double) Item_sum_udf_int::val_int(); } String *val_str(String*str); @@ -583,7 +584,6 @@ public: :Item_udf_sum(udf_arg,list) {} Item_sum_udf_str(THD *thd, Item_sum_udf_str &item) :Item_udf_sum(thd, item) {} - ~Item_sum_udf_str() {} String *val_str(String *); double val() { @@ -612,7 +612,6 @@ class Item_sum_udf_float :public Item_sum_num Item_sum_udf_float(udf_func *udf_arg, List &list) :Item_sum_num() {} Item_sum_udf_float(THD *thd, Item_sum_udf_float &item) :Item_sum_num(thd, item) {} - ~Item_sum_udf_float() {} enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } double val() { return 0.0; } void clear() {} @@ -628,7 +627,6 @@ public: Item_sum_udf_int(udf_func *udf_arg, List &list) :Item_sum_num() {} Item_sum_udf_int(THD *thd, Item_sum_udf_int &item) :Item_sum_num(thd, item) {} - ~Item_sum_udf_int() {} enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } longlong val_int() { return 0; } double val() { return 0; } @@ -645,7 +643,6 @@ public: Item_sum_udf_str(udf_func *udf_arg, List &list) :Item_sum_num() {} Item_sum_udf_str(THD *thd, Item_sum_udf_str &item) :Item_sum_num(thd, item) {} - ~Item_sum_udf_str() {} String *val_str(String *) { null_value=1; return 0; } double val() { null_value=1; return 0.0; } longlong val_int() { null_value=1; return 0; } @@ -734,6 +731,8 @@ class Item_func_group_concat : public Item_sum quick_group= item.quick_group; }; ~Item_func_group_concat(); + void cleanup(); + enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;} const char *func_name() const { return "group_concat"; } enum Type type() const { return SUM_FUNC_ITEM; } -- cgit v1.2.1 From 25a2c07330241d88a439161d14d0390aac00945c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Jan 2004 19:53:25 +0400 Subject: Code cleanup (working on PS & cleanup() code) Item & changed with Item* in Item_xxx constructors tables_list.first -> get_table_list() sql/item.cc: Item& -> Item* sql/item.h: Item& -> Item* sql/item_cmpfunc.cc: Item& -> Item* sql/item_cmpfunc.h: Item& -> Item* sql/item_func.cc: Item& -> Item* sql/item_func.h: Item& -> Item* sql/item_sum.cc: Item& -> Item* sql/item_sum.h: Item& -> Item* sql/item_uniq.h: Item& -> Item* sql/sql_prepare.cc: Code cleanup sql/sql_select.cc: Item& -> Item* --- sql/item_sum.h | 124 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'sql/item_sum.h') diff --git a/sql/item_sum.h b/sql/item_sum.h index dd180d42011..9f1c8a09a4e 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -57,7 +57,7 @@ public: } Item_sum(List &list); //Copy constructor, need to perform subselects with temporary tables - Item_sum(THD *thd, Item_sum &item); + Item_sum(THD *thd, Item_sum *item); void cleanup() { Item_result_field::cleanup(); @@ -110,7 +110,7 @@ public: Item_sum_num(Item *item_par) :Item_sum(item_par) {} Item_sum_num(Item *a, Item* b) :Item_sum(a,b) {} Item_sum_num(List &list) :Item_sum(list) {} - Item_sum_num(THD *thd, Item_sum_num &item) :Item_sum(thd, item) {} + Item_sum_num(THD *thd, Item_sum_num *item) :Item_sum(thd, item) {} bool fix_fields(THD *, TABLE_LIST *, Item **); longlong val_int() { return (longlong) val(); } /* Real as default */ String *val_str(String*str); @@ -123,7 +123,7 @@ class Item_sum_int :public Item_sum_num public: Item_sum_int(Item *item_par) :Item_sum_num(item_par) {} Item_sum_int(List &list) :Item_sum_num(list) {} - Item_sum_int(THD *thd, Item_sum_int &item) :Item_sum_num(thd, item) {} + Item_sum_int(THD *thd, Item_sum_int *item) :Item_sum_num(thd, item) {} double val() { return (double) val_int(); } String *val_str(String*str); enum Item_result result_type () const { return INT_RESULT; } @@ -139,8 +139,8 @@ class Item_sum_sum :public Item_sum_num public: Item_sum_sum(Item *item_par) :Item_sum_num(item_par),sum(0.0) {} - Item_sum_sum(THD *thd, Item_sum_sum &item) - :Item_sum_num(thd, item), sum(item.sum) {} + Item_sum_sum(THD *thd, Item_sum_sum *item) + :Item_sum_num(thd, item), sum(item->sum) {} enum Sumfunctype sum_func () const {return SUM_FUNC;} void clear(); bool add(); @@ -162,9 +162,9 @@ class Item_sum_count :public Item_sum_int Item_sum_count(Item *item_par) :Item_sum_int(item_par),count(0),used_table_cache(~(table_map) 0) {} - Item_sum_count(THD *thd, Item_sum_count &item) - :Item_sum_int(thd, item), count(item.count), - used_table_cache(item.used_table_cache) + Item_sum_count(THD *thd, Item_sum_count *item) + :Item_sum_int(thd, item), count(item->count), + used_table_cache(item->used_table_cache) {} table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } @@ -230,14 +230,14 @@ class Item_sum_count_distinct :public Item_sum_int tmp_table_param(0), tree(&tree_base), original(0), use_tree(0), always_null(0) { quick_group= 0; } - 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), - 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), - always_null(item.always_null) + 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), + 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), + always_null(item->always_null) {} void cleanup(); @@ -285,8 +285,8 @@ class Item_sum_avg :public Item_sum_num public: Item_sum_avg(Item *item_par) :Item_sum_num(item_par),count(0) {} - Item_sum_avg(THD *thd, Item_sum_avg &item) - :Item_sum_num(thd, item), sum(item.sum), count(item.count) {} + Item_sum_avg(THD *thd, Item_sum_avg *item) + :Item_sum_num(thd, item), sum(item->sum), count(item->count) {} enum Sumfunctype sum_func () const {return AVG_FUNC;} void clear(); bool add(); @@ -337,9 +337,9 @@ class Item_sum_variance : public Item_sum_num public: Item_sum_variance(Item *item_par) :Item_sum_num(item_par),count(0) {} - Item_sum_variance(THD *thd, Item_sum_variance &item): - Item_sum_num(thd, item), sum(item.sum), sum_sqr(item.sum_sqr), - count(item.count) {} + Item_sum_variance(THD *thd, Item_sum_variance *item): + Item_sum_num(thd, item), sum(item->sum), sum_sqr(item->sum_sqr), + count(item->count) {} enum Sumfunctype sum_func () const { return VARIANCE_FUNC; } void clear(); bool add(); @@ -370,7 +370,7 @@ class Item_sum_std :public Item_sum_variance { public: Item_sum_std(Item *item_par) :Item_sum_variance(item_par) {} - Item_sum_std(THD *thd, Item_sum_std &item) + Item_sum_std(THD *thd, Item_sum_std *item) :Item_sum_variance(thd, item) {} enum Sumfunctype sum_func () const { return STD_FUNC; } @@ -401,11 +401,11 @@ class Item_sum_hybrid :public Item_sum used_table_cache(~(table_map) 0), cmp_charset(&my_charset_bin) {} - Item_sum_hybrid(THD *thd, Item_sum_hybrid &item): - Item_sum(thd, item), value(item.value), tmp_value(item.tmp_value), - sum(item.sum), sum_int(item.sum_int), hybrid_type(item.hybrid_type), - hybrid_field_type(item.hybrid_field_type),cmp_sign(item.cmp_sign), - used_table_cache(item.used_table_cache), cmp_charset(item.cmp_charset) {} + Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): + Item_sum(thd, item), value(item->value), tmp_value(item->tmp_value), + sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), + hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), + used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} bool fix_fields(THD *, TABLE_LIST *, Item **); table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } @@ -436,7 +436,7 @@ class Item_sum_min :public Item_sum_hybrid { public: Item_sum_min(Item *item_par) :Item_sum_hybrid(item_par,1) {} - Item_sum_min(THD *thd, Item_sum_min &item) :Item_sum_hybrid(thd, item) {} + Item_sum_min(THD *thd, Item_sum_min *item) :Item_sum_hybrid(thd, item) {} enum Sumfunctype sum_func () const {return MIN_FUNC;} bool add(); @@ -449,7 +449,7 @@ class Item_sum_max :public Item_sum_hybrid { public: Item_sum_max(Item *item_par) :Item_sum_hybrid(item_par,-1) {} - Item_sum_max(THD *thd, Item_sum_max &item) :Item_sum_hybrid(thd, item) {} + Item_sum_max(THD *thd, Item_sum_max *item) :Item_sum_hybrid(thd, item) {} enum Sumfunctype sum_func () const {return MAX_FUNC;} bool add(); @@ -466,8 +466,8 @@ protected: public: Item_sum_bit(Item *item_par,ulonglong reset_arg) :Item_sum_int(item_par),reset_bits(reset_arg),bits(reset_arg) {} - Item_sum_bit(THD *thd, Item_sum_bit &item): - Item_sum_int(thd, item), reset_bits(item.reset_bits), bits(item.bits) {} + Item_sum_bit(THD *thd, Item_sum_bit *item): + Item_sum_int(thd, item), reset_bits(item->reset_bits), bits(item->bits) {} enum Sumfunctype sum_func () const {return SUM_BIT_FUNC;} void clear(); longlong val_int(); @@ -482,7 +482,7 @@ class Item_sum_or :public Item_sum_bit { public: Item_sum_or(Item *item_par) :Item_sum_bit(item_par,LL(0)) {} - Item_sum_or(THD *thd, Item_sum_or &item) :Item_sum_bit(thd, item) {} + Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {} bool add(); const char *func_name() const { return "bit_or"; } Item *copy_or_same(THD* thd); @@ -493,7 +493,7 @@ class Item_sum_and :public Item_sum_bit { public: Item_sum_and(Item *item_par) :Item_sum_bit(item_par, ULONGLONG_MAX) {} - Item_sum_and(THD *thd, Item_sum_and &item) :Item_sum_bit(thd, item) {} + Item_sum_and(THD *thd, Item_sum_and *item) :Item_sum_bit(thd, item) {} bool add(); const char *func_name() const { return "bit_and"; } Item *copy_or_same(THD* thd); @@ -503,7 +503,7 @@ class Item_sum_xor :public Item_sum_bit { public: Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,LL(0)) {} - Item_sum_xor(THD *thd, Item_sum_xor &item) :Item_sum_bit(thd, item) {} + Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {} bool add(); const char *func_name() const { return "bit_xor"; } Item *copy_or_same(THD* thd); @@ -525,8 +525,8 @@ public: Item_udf_sum( udf_func *udf_arg, List &list ) :Item_sum( list ), udf(udf_arg) { quick_group=0;} - Item_udf_sum(THD *thd, Item_udf_sum &item) - :Item_sum(thd, item), udf(item.udf) {} + Item_udf_sum(THD *thd, Item_udf_sum *item) + :Item_sum(thd, item), udf(item->udf) {} const char *func_name() const { return udf.name(); } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { @@ -549,7 +549,7 @@ class Item_sum_udf_float :public Item_udf_sum Item_sum_udf_float(udf_func *udf_arg) :Item_udf_sum(udf_arg) {} Item_sum_udf_float(udf_func *udf_arg, List &list) :Item_udf_sum(udf_arg,list) {} - Item_sum_udf_float(THD *thd, Item_sum_udf_float &item) + Item_sum_udf_float(THD *thd, Item_sum_udf_float *item) :Item_udf_sum(thd, item) {} longlong val_int() { return (longlong) Item_sum_udf_float::val(); } double val(); @@ -565,7 +565,7 @@ public: Item_sum_udf_int(udf_func *udf_arg) :Item_udf_sum(udf_arg) {} Item_sum_udf_int(udf_func *udf_arg, List &list) :Item_udf_sum(udf_arg,list) {} - Item_sum_udf_int(THD *thd, Item_sum_udf_int &item) + Item_sum_udf_int(THD *thd, Item_sum_udf_int *item) :Item_udf_sum(thd, item) {} longlong val_int(); double val() { return (double) Item_sum_udf_int::val_int(); } @@ -582,7 +582,7 @@ public: Item_sum_udf_str(udf_func *udf_arg) :Item_udf_sum(udf_arg) {} Item_sum_udf_str(udf_func *udf_arg, List &list) :Item_udf_sum(udf_arg,list) {} - Item_sum_udf_str(THD *thd, Item_sum_udf_str &item) + Item_sum_udf_str(THD *thd, Item_sum_udf_str *item) :Item_udf_sum(thd, item) {} String *val_str(String *); double val() @@ -704,31 +704,31 @@ class Item_func_group_concat : public Item_sum Item_func_group_concat(bool is_distinct,List *is_select, SQL_LIST *is_order,String *is_separator); - Item_func_group_concat(THD *thd, Item_func_group_concat &item) + Item_func_group_concat(THD *thd, Item_func_group_concat *item) :Item_sum(thd, item),item_thd(thd), - tmp_table_param(item.tmp_table_param), - max_elements_in_tree(item.max_elements_in_tree), - warning(item.warning), - warning_available(item.warning_available), - key_length(item.key_length), - rec_offset(item.rec_offset), - tree_mode(item.tree_mode), - distinct(item.distinct), - warning_for_row(item.warning_for_row), - separator(item.separator), - tree(item.tree), - table(item.table), - order(item.order), - tables_list(item.tables_list), - group_concat_max_len(item.group_concat_max_len), - show_elements(item.show_elements), - arg_count_order(item.arg_count_order), - arg_count_field(item.arg_count_field), - arg_show_fields(item.arg_show_fields), - count_cut_values(item.count_cut_values), - original(&item) + tmp_table_param(item->tmp_table_param), + max_elements_in_tree(item->max_elements_in_tree), + warning(item->warning), + warning_available(item->warning_available), + key_length(item->key_length), + rec_offset(item->rec_offset), + tree_mode(item->tree_mode), + distinct(item->distinct), + warning_for_row(item->warning_for_row), + separator(item->separator), + tree(item->tree), + table(item->table), + order(item->order), + tables_list(item->tables_list), + group_concat_max_len(item->group_concat_max_len), + show_elements(item->show_elements), + arg_count_order(item->arg_count_order), + arg_count_field(item->arg_count_field), + arg_show_fields(item->arg_show_fields), + count_cut_values(item->count_cut_values), + original(item) { - quick_group= item.quick_group; + quick_group= item->quick_group; }; ~Item_func_group_concat(); void cleanup(); -- cgit v1.2.1 From 263919379b5903614d2145048757566b3098da25 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jan 2004 20:55:47 +0400 Subject: Pack of changes about 'cleanup()'-s Some errorneous code trimmed sql/item.cc: initialization of the Item_type_holder::orig_item added sql/item.h: No use to call cleanup() in ~Item this only calls Item::cleanup() We should use item->delete_self() instead of 'delete item' now Code added to restore Item_type_holder::item_type value sql/item_row.h: this cleanup is wrong sql/item_sum.cc: initialization added sql/item_sum.h: Item_xxx& -> Item_xxx* sql/sql_parse.cc: delete item -> item->delete_self() --- sql/item_sum.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sql/item_sum.h') diff --git a/sql/item_sum.h b/sql/item_sum.h index 9f1c8a09a4e..dc84e4d4ab7 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -610,7 +610,7 @@ class Item_sum_udf_float :public Item_sum_num public: Item_sum_udf_float(udf_func *udf_arg) :Item_sum_num() {} Item_sum_udf_float(udf_func *udf_arg, List &list) :Item_sum_num() {} - Item_sum_udf_float(THD *thd, Item_sum_udf_float &item) + Item_sum_udf_float(THD *thd, Item_sum_udf_float *item) :Item_sum_num(thd, item) {} enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } double val() { return 0.0; } @@ -625,7 +625,7 @@ class Item_sum_udf_int :public Item_sum_num public: Item_sum_udf_int(udf_func *udf_arg) :Item_sum_num() {} Item_sum_udf_int(udf_func *udf_arg, List &list) :Item_sum_num() {} - Item_sum_udf_int(THD *thd, Item_sum_udf_int &item) + Item_sum_udf_int(THD *thd, Item_sum_udf_int *item) :Item_sum_num(thd, item) {} enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; } longlong val_int() { return 0; } @@ -641,7 +641,7 @@ class Item_sum_udf_str :public Item_sum_num public: Item_sum_udf_str(udf_func *udf_arg) :Item_sum_num() {} Item_sum_udf_str(udf_func *udf_arg, List &list) :Item_sum_num() {} - Item_sum_udf_str(THD *thd, Item_sum_udf_str &item) + Item_sum_udf_str(THD *thd, Item_sum_udf_str *item) :Item_sum_num(thd, item) {} String *val_str(String *) { null_value=1; return 0; } double val() { null_value=1; return 0.0; } -- cgit v1.2.1 From de0fbb0619d47194be0e5fd2e0b257ccd73460d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Feb 2004 12:31:03 +0100 Subject: Added --compact to mysqlbinlog Fixed output from mysqlbinlog when using --skip-comments Fixed warnings from valgrind Fixed ref_length when used with HEAP tables More efficent need_conversion() Fixed error handling in UPDATE with not updateable tables Fixed bug in null handling in CAST to signed/unsigned client/client_priv.h: cleanup & added OPT_COMPACT client/mysqldump.c: Added option --compact to get a compact readable dump. Ensure that SET CHARACTER_SET_CLIENT is not done if we have not remembered the old character set Print optimization comments even if --skip-comments are given as these are not true comments. (Before these where only printed at end, which was a bug) mysql-test/r/cast.result: More cast tests mysql-test/r/derived.result: Removed warnings mysql-test/r/mysqldump.result: Update results after fixing mysqlbinlog mysql-test/r/query_cache.result: Make test usable with --extern more tests mysql-test/r/rpl_until.result: Make test repeatable under valgrind mysql-test/r/sql_mode.result: Fix test result mysql-test/r/subselect.result: Make test smaller. Update wrong results mysql-test/t/cast.test: More cast tests mysql-test/t/derived.test: Removed warnings mysql-test/t/query_cache.test: Make test usable with --extern more tests mysql-test/t/rpl_until.test: fix for valgrind. Becasue of unknown reason one got 'Slave_SQL_Running=yes' in this setup mysql-test/t/subselect.test: Make test case smaller sql/field.cc: Updated need_conversion() to use new arguments sql/ha_heap.cc: Moved initialization of ref_length to right place. This fixed problem that we had a ref_length of 8 for heap tables, which was not efficent. sql/item_func.cc: Cleanup sql/item_func.h: Fixed bug in null_handling for cast to signed/unsigned sql/item_strfunc.cc: Optimized/cleaned up Item_func_conv_charset3 sql/item_sum.cc: Cleanup. Ensure that some flag variables are cleared in cleanup() sql/item_sum.h: Fixed references to uninitialized memory sql/opt_range.cc: Fixed spelling error sql/sql_class.cc: Fixed wrong return code, which could case protocol problems sql/sql_class.h: After merge fix sql/sql_prepare.cc: Added comments sql/sql_show.cc: Cleanup sql/sql_string.cc: Optimzed usage of need_conversion(). - Removed not used argument - Save diff lenght in 'offset' to not have to recalculate length several times. Cleaned up comment Optimized copy_aligned() based on the knowledge that it's only called when you have wrong data sql/sql_string.h: Updated need_conversion() and copy_aligned() to use new arguments sql/sql_update.cc: Fixed error handling with non-updateable tables sql/sql_yacc.yy: Ensure that lex->lock_options are set correctly (to get rid of warnings from valgrind) Ensure that cast_type sets lex->charset and lex->length. Without these CONVERT() didn't work properly --- sql/item_sum.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sql/item_sum.h') diff --git a/sql/item_sum.h b/sql/item_sum.h index dc84e4d4ab7..bb03f029997 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -397,12 +397,13 @@ class Item_sum_hybrid :public Item_sum public: Item_sum_hybrid(Item *item_par,int sign) - :Item_sum(item_par), hybrid_type(INT_RESULT), cmp_sign(sign), - used_table_cache(~(table_map) 0), + :Item_sum(item_par), sum(0.0), sum_int(0), + hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), + cmp_sign(sign), used_table_cache(~(table_map) 0), cmp_charset(&my_charset_bin) {} Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): - Item_sum(thd, item), value(item->value), tmp_value(item->tmp_value), + Item_sum(thd, item), value(item->value), sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} -- cgit v1.2.1