From: Mattias Jonsson Date: April 29 2011 8:48am Subject: bzr push into mysql-5.5 branch (mattias.jonsson:3476 to 3477) List-Archive: http://lists.mysql.com/commits/136370 Message-Id: <201104290848.p3T8mT7H002326@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3477 Mattias Jonsson 2011-04-29 [merge] merge modified: mysql-test/r/partition_myisam.result mysql-test/suite/parts/inc/partition_fail.inc mysql-test/t/partition_myisam.test sql/ha_partition.cc 3476 Georgi Kodinov 2011-04-29 Addendum to the fix for bug #12325444 Removed STDCALL from the function definition. modified: sql-common/client_plugin.c === modified file 'mysql-test/r/partition_myisam.result' --- a/mysql-test/r/partition_myisam.result 2011-03-31 12:38:54 +0000 +++ b/mysql-test/r/partition_myisam.result 2011-04-27 16:42:05 +0000 @@ -239,3 +239,12 @@ a DROP TABLE t1; # Should not be any files left here # End of bug#30102 test. +# Test of post-push fix for bug#11766249/59316 +CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a)) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100, +PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100, +PARTITION pMax VALUES LESS THAN MAXVALUE); +INSERT INTO t1 VALUES (1, "Partition p1, first row"); +DROP TABLE t1; === modified file 'mysql-test/suite/parts/inc/partition_fail.inc' --- a/mysql-test/suite/parts/inc/partition_fail.inc 2010-10-01 13:59:07 +0000 +++ b/mysql-test/suite/parts/inc/partition_fail.inc 2011-04-29 07:56:36 +0000 @@ -23,6 +23,7 @@ DROP TABLE t1; --eval $create_statement --eval $insert_statement --echo # State before failure +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result @@ -32,6 +33,7 @@ LOCK TABLE t1 WRITE; --eval $fail_statement --enable_abort_on_error --echo # State after failure +--replace_result #p# #P# #sp# #SP# --list_files $DATADIR/test SHOW CREATE TABLE t1; --sorted_result === modified file 'mysql-test/t/partition_myisam.test' --- a/mysql-test/t/partition_myisam.test 2011-03-31 12:38:54 +0000 +++ b/mysql-test/t/partition_myisam.test 2011-04-27 16:42:05 +0000 @@ -1,5 +1,4 @@ --- source include/have_partition.inc - +--source include/have_partition.inc --disable_warnings DROP TABLE IF EXISTS t1, t2; --enable_warnings @@ -171,3 +170,13 @@ DROP TABLE t1; --list_files $MYSQLD_DATADIR/test t1* --list_files $MYSQLD_DATADIR/test t2* --echo # End of bug#30102 test. + +--echo # Test of post-push fix for bug#11766249/59316 +CREATE TABLE t1 (a INT, b VARCHAR(255), PRIMARY KEY (a)) +ENGINE = MyISAM +PARTITION BY RANGE (a) +(PARTITION p0 VALUES LESS THAN (0) MAX_ROWS=100, + PARTITION p1 VALUES LESS THAN (100) MAX_ROWS=100, + PARTITION pMax VALUES LESS THAN MAXVALUE); +INSERT INTO t1 VALUES (1, "Partition p1, first row"); +DROP TABLE t1; === modified file 'sql/ha_partition.cc' --- a/sql/ha_partition.cc 2011-04-26 11:26:41 +0000 +++ b/sql/ha_partition.cc 2011-04-29 07:56:36 +0000 @@ -2739,7 +2739,7 @@ int ha_partition::open(const char *name, (PARTITION_ENABLED_TABLE_FLAGS)); while (*(++file)) { - DBUG_ASSERT(ref_length >= (*file)->ref_length); + /* MyISAM can have smaller ref_length for partitions with MAX_ROWS set */ set_if_bigger(ref_length, ((*file)->ref_length)); /* Verify that all partitions have the same set of table flags. @@ -4089,19 +4089,16 @@ end_dont_reset_start_part: void ha_partition::position(const uchar *record) { handler *file= m_file[m_last_part]; + uint pad_length; DBUG_ENTER("ha_partition::position"); file->position(record); int2store(ref, m_last_part); - memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, - (ref_length - PARTITION_BYTES_IN_POS)); + memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, file->ref_length); + pad_length= m_ref_length - PARTITION_BYTES_IN_POS - file->ref_length; + if (pad_length) + memset((ref + PARTITION_BYTES_IN_POS + file->ref_length), 0, pad_length); -#ifdef SUPPORTING_PARTITION_OVER_DIFFERENT_ENGINES -#ifdef HAVE_purify - bzero(ref + PARTITION_BYTES_IN_POS + ref_length, - max_ref_length-ref_length); -#endif /* HAVE_purify */ -#endif DBUG_VOID_RETURN; } No bundle (reason: useless for push emails).