From: Date: July 5 2007 11:31am Subject: bk commit into 5.1 tree (istruewing:1.2528) BUG#26827 List-Archive: http://lists.mysql.com/commits/30355 X-Bug: 26827 Message-Id: Below is the list of changes that have just been committed into a local 5.1 repository of istruewing. When istruewing 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, 2007-07-05 11:31:03+02:00, istruewing@stripped +2 -0 Bug#26827 - table->read_set is set incorrectly, causing update of a different column Post-pushbuild fix. bitmap_set_bit() is an inline function in DEBUG builds and a macro in non-DEBUG builds. The latter evaluates its 'bit' argument twice. So one must not use increment/decrement operators on this argument. Moved increment of pointer out of bitmap_set_bit() call. include/my_bitmap.h@stripped, 2007-07-05 11:30:59+02:00, istruewing@stripped +11 -0 Bug#26827 - table->read_set is set incorrectly, causing update of a different column Added a warning comment. sql/sql_partition.cc@stripped, 2007-07-05 11:30:59+02:00, istruewing@stripped +2 -2 Bug#26827 - table->read_set is set incorrectly, causing update of a different column Moved increment of pointer out of bitmap_set_bit() call. diff -Nrup a/include/my_bitmap.h b/include/my_bitmap.h --- a/include/my_bitmap.h 2006-12-23 20:19:44 +01:00 +++ b/include/my_bitmap.h 2007-07-05 11:30:59 +02:00 @@ -103,6 +103,17 @@ extern void bitmap_lock_invert(MY_BITMAP &= ~ (1 << ((BIT) & 7))) #define _bitmap_is_set(MAP, BIT) (uint) (((uchar*)(MAP)->bitmap)[(BIT) / 8] \ & (1 << ((BIT) & 7))) +/* + WARNING! + + The below symbols are inline functions in DEBUG builds and macros in + non-DEBUG builds. The latter evaluate their 'bit' argument twice. + + NEVER use an increment/decrement operator with the 'bit' argument. + It would work with DEBUG builds, but fails later in production builds! + + FORBIDDEN: bitmap_set_bit($my_bitmap, (field++)->field_index); +*/ #ifndef DBUG_OFF static inline void bitmap_set_bit(MY_BITMAP *map,uint bit) diff -Nrup a/sql/sql_partition.cc b/sql/sql_partition.cc --- a/sql/sql_partition.cc 2007-07-04 21:55:21 +02:00 +++ b/sql/sql_partition.cc 2007-07-05 11:30:59 +02:00 @@ -606,8 +606,8 @@ static bool create_full_part_field_array partitioning. */ if ((ptr= part_info->full_part_field_array)) - while (*ptr) - bitmap_set_bit(&part_info->full_part_field_set, (*ptr++)->field_index); + for (; *ptr; ptr++) + bitmap_set_bit(&part_info->full_part_field_set, (*ptr)->field_index); end: DBUG_RETURN(result);