Hi Evgeny,
the fix is approved.
Roy
On 22.03.11 20.41, Evgeny Potemkin wrote:
> #At file:///work/bzrroot/11808582-bug/ based on
> revid:epotemkin@stripped
>
> 3004 Evgeny Potemkin 2011-03-22
> Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN MC_REPLACE_STRMEM.C:493)
> TABLE_SHARE::column_bitmap_size wasn't initialized for tmp tables. This
> caused valgrind to throw a warning.
> Now setup_tmp_table_column_bitmaps initializes
> TABLE_SHARE::column_bitmap_size.
> @ mysql-test/r/derived.result
> Added a test case for the bug#11808582.
> @ mysql-test/t/derived.test
> Added a test case for the bug#11808582.
> @ sql/sql_select.cc
> Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN
> MC_REPLACE_STRMEM.C:493)
> Now setup_tmp_table_column_bitmaps initializes
> TABLE_SHARE::column_bitmap_size.
>
> modified:
> mysql-test/r/derived.result
> mysql-test/t/derived.test
> sql/sql_select.cc
> === modified file 'mysql-test/r/derived.result'
> --- a/mysql-test/r/derived.result 2011-03-18 08:59:36 +0000
> +++ b/mysql-test/r/derived.result 2011-03-22 19:41:04 +0000
> @@ -1345,3 +1345,25 @@ FROM t1
> 1
> DROP TABLE t1;
> #
> +#
> +# Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN MC_REPLACE_STRMEM.C:493)
> +#
> +CREATE TABLE t1 (
> +pk INT NOT NULL AUTO_INCREMENT,
> +col_int_key INT,
> +col_time_key time,
> +col_varchar_key VARCHAR(1),
> +PRIMARY KEY (pk),
> +KEY col_int_key (col_int_key),
> +KEY col_varchar_key (col_varchar_key,col_int_key)
> +) ENGINE=InnoDB;
> +SELECT tt.col_time_key
> +FROM ( ( SELECT * FROM t1 ) AS tt
> +INNER JOIN t1
> +ON (t1.col_int_key = tt.col_int_key)
> +)
> +WHERE tt.col_int_key = 207
> +ORDER BY tt.col_varchar_key, tt.pk ASC, 1;
> +col_time_key
> +DROP TABLE t1;
> +#
>
> === modified file 'mysql-test/t/derived.test'
> --- a/mysql-test/t/derived.test 2011-03-18 08:59:36 +0000
> +++ b/mysql-test/t/derived.test 2011-03-22 19:41:04 +0000
> @@ -712,3 +712,26 @@ FROM (
> DROP TABLE t1;
> --echo #
>
> +--echo #
> +--echo # Bug#11808582: VALGRIND ON WL#5274: INVALID WRITE IN
> MC_REPLACE_STRMEM.C:493)
> +--echo #
> +CREATE TABLE t1 (
> + pk INT NOT NULL AUTO_INCREMENT,
> + col_int_key INT,
> + col_time_key time,
> + col_varchar_key VARCHAR(1),
> + PRIMARY KEY (pk),
> + KEY col_int_key (col_int_key),
> + KEY col_varchar_key (col_varchar_key,col_int_key)
> +) ENGINE=InnoDB;
> +SELECT tt.col_time_key
> +FROM ( ( SELECT * FROM t1 ) AS tt
> + INNER JOIN t1
> + ON (t1.col_int_key = tt.col_int_key)
> + )
> +WHERE tt.col_int_key = 207
> +ORDER BY tt.col_varchar_key, tt.pk ASC, 1;
> +
> +DROP TABLE t1;
> +--echo #
> +
>
> === modified file 'sql/sql_select.cc'
> --- a/sql/sql_select.cc 2011-03-18 08:59:36 +0000
> +++ b/sql/sql_select.cc 2011-03-22 19:41:04 +0000
> @@ -15397,6 +15397,7 @@ void setup_tmp_table_column_bitmaps(TABL
> table->s->all_set= table->def_read_set;
> bitmap_set_all(&table->s->all_set);
> table->default_column_bitmaps();
> + table->s->column_bitmap_size= bitmap_buffer_size(field_count);
> }
>
>
>
>
>
>