From: Date: October 18 2006 1:20pm Subject: bk commit into 5.0 tree (kroki:1.2286) BUG#21354 List-Archive: http://lists.mysql.com/commits/13855 X-Bug: 21354 Message-Id: <200610181120.k9IBKl7w020655@moonlight.intranet> Below is the list of changes that have just been committed into a local 5.0 repository of tomash. When tomash does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2006-10-18 15:20:34+04:00, kroki@stripped +2 -0 Fix for valgrind warning introduced by the fix for bug#21354: (COUNT(*) = 1) not working in SELECT inside prepared statement. Note: the warning was introduced in 5.0 and 5.1, 4.1 is OK with the original fix. The problem was that in 5.0 and 5.1 clear() for group functions may access hybrid_type member, and this member is initialized in fix_fields(). So we should not call clear() from item cleanup() methods, as cleanup() may be called for unfixed items. sql/item_sum.cc@stripped, 2006-10-18 15:20:31+04:00, kroki@stripped +1 -1 Do not call clear() from item cleanup() methods, as cleanup() may be called for unfixed items, and clear() assumes the item was fixed. sql/item_sum.h@stripped, 2006-10-18 15:20:31+04:00, kroki@stripped +5 -4 Do not call clear() from item cleanup() methods, as cleanup() may be called for unfixed items, and clear() assumes the item was fixed. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: kroki # Host: moonlight.intranet # Root: /home/tomash/src/mysql_ab/mysql-5.0-bug21354 --- 1.182/sql/item_sum.cc 2006-10-18 15:20:47 +04:00 +++ 1.183/sql/item_sum.cc 2006-10-18 15:20:47 +04:00 @@ -1055,7 +1055,7 @@ longlong Item_sum_count::val_int() void Item_sum_count::cleanup() { DBUG_ENTER("Item_sum_count::cleanup"); - clear(); + count= 0; Item_sum_int::cleanup(); used_table_cache= ~(table_map) 0; DBUG_VOID_RETURN; --- 1.104/sql/item_sum.h 2006-10-18 15:20:47 +04:00 +++ 1.105/sql/item_sum.h 2006-10-18 15:20:47 +04:00 @@ -643,8 +643,8 @@ public: Field *create_tmp_field(bool group, TABLE *table, uint convert_blob_length); void cleanup() { - clear(); - Item_sum_num::cleanup(); + count= 0; + Item_sum_sum::cleanup(); } }; @@ -727,7 +727,8 @@ public: enum Item_result result_type () const { return REAL_RESULT; } void cleanup() { - clear(); + cur_dec= 0; + count= 0; Item_sum_num::cleanup(); } }; @@ -862,7 +863,7 @@ public: { decimals= 0; max_length=21; unsigned_flag= 1; maybe_null= null_value= 0; } void cleanup() { - clear(); + bits= reset_bits; Item_sum_int::cleanup(); } };