From: Date: June 28 2007 1:35pm Subject: bk commit into 5.1 tree (holyfoot:1.2518) BUG#28430 List-Archive: http://lists.mysql.com/commits/29852 X-Bug: 28430 Message-Id: <20070628113526.ADB562C380A5@hfmain.localdomain> Below is the list of changes that have just been committed into a local 5.1 repository of hf. When hf 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-06-28 16:35:21+05:00, holyfoot@stripped +3 -0 Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format. In the ha_partition::position() we didn't calculate the number of the partition of the record. We used m_last_part value instead, relying on that it is set in other place like previous call of a method like ::write_row(). In replication we don't call any of these befor position(). Delete_rows_log_event::do_exec_row calls find_and_fetch_row. In case of InnoDB-based PARTITION table, we have HA_PRIMARY_KEY_REQUIRED_FOR_POSITION enabled, so use position() / rnd_pos() calls to fetch the record. Fixed by adding partition_id calculation to the ha_partition::position() mysql-test/r/partition_pruning.result@stripped, 2007-06-28 16:35:20+05:00, holyfoot@stripped +2 -2 Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format test result fixed sql/ha_partition.cc@stripped, 2007-06-28 16:35:20+05:00, holyfoot@stripped +13 -1 Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format Calculate the number of the partition in ha_partition::position() ha_partition::column_bitmaps_signal() implemented sql/ha_partition.h@stripped, 2007-06-28 16:35:20+05:00, holyfoot@stripped +1 -0 Bug #28430 Failure in replication of innodb partitioned tables on row/mixed format column_bitmaps_signal interface added diff -Nrup a/mysql-test/r/partition_pruning.result b/mysql-test/r/partition_pruning.result --- a/mysql-test/r/partition_pruning.result 2006-08-02 16:00:47 +05:00 +++ b/mysql-test/r/partition_pruning.result 2007-06-28 16:35:20 +05:00 @@ -631,7 +631,7 @@ flush status; delete from t2 where b > 5; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 @@ -645,7 +645,7 @@ flush status; delete from t2 where b < 5 or b > 3; show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 1215 +Handler_read_rnd_next 1115 show status like 'Handler_read_key'; Variable_name Value Handler_read_key 0 diff -Nrup a/sql/ha_partition.cc b/sql/ha_partition.cc --- a/sql/ha_partition.cc 2007-06-26 15:36:36 +05:00 +++ b/sql/ha_partition.cc 2007-06-28 16:35:20 +05:00 @@ -3176,9 +3176,14 @@ end: void ha_partition::position(const uchar *record) { - handler *file= m_file[m_last_part]; + handler *file; DBUG_ENTER("ha_partition::position"); + if (unlikely(get_part_for_delete(record, m_rec0, m_part_info, &m_last_part))) + m_last_part= 0; + + file= m_file[m_last_part]; + file->position(record); int2store(ref, m_last_part); memcpy((ref + PARTITION_BYTES_IN_POS), file->ref, @@ -4170,6 +4175,13 @@ void ha_partition::include_partition_fie bitmap_set_bit(table->read_set, (*ptr)->field_index); } while (*(++ptr)); DBUG_VOID_RETURN; +} + + +void ha_partition::column_bitmaps_signal() +{ + handler::column_bitmaps_signal(); + include_partition_fields_in_used_fields(); } diff -Nrup a/sql/ha_partition.h b/sql/ha_partition.h --- a/sql/ha_partition.h 2007-05-24 03:39:18 +05:00 +++ b/sql/ha_partition.h 2007-06-28 16:35:20 +05:00 @@ -450,6 +450,7 @@ private: int handle_ordered_prev(uchar * buf); void return_top_record(uchar * buf); void include_partition_fields_in_used_fields(); + virtual void column_bitmaps_signal(); public: /* -------------------------------------------------------------------------