From: Alexander Nozdrin Date: July 15 2011 12:19pm Subject: bzr push into mysql-5.1 branch (alexander.nozdrin:3571 to 3572) Bug#59060 List-Archive: http://lists.mysql.com/commits/140320 X-Bug: 59060 Message-Id: <201107151219.p6FCJT2u018088@acsmt356.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3572 Alexander Nozdrin 2011-07-15 Backport a fix for Bug#59060 (Valgrind warning in Protocol_text::store()). Original changeset: revision-id: alexander.nozdrin@stripped parent: sven.sandberg@stripped committer: Alexander Nozdrin branch nick: mysql-trunk-bugfixing timestamp: Tue 2010-12-21 15:23:49 +0300 message: A patch for Bug#59060 (Valgrind warning in Protocol_text::store()). We should not assume to have zero-terminated strings. modified: sql/protocol.cc 3571 Luis Soares 2011-07-14 BUG#11753004: 44360: REPLICATION FAILED The server crashes if it processes table map events that are corrupted, especially if they map different tables to the same identifier. This could happen, for instance, due to BUG 56226. We fix this by checking whether the table map has already been mapped before actually applying the event. If it has been mapped with different settings an error is raised and the slave SQL thread stops. If it has been mapped with same settings the event is skipped. If the table is set to be ignored by the filtering rules, there is no change in behavior: the event is skipped and ids are not checked. @ mysql-test/suite/rpl/t/rpl_row_corruption.test Added a simple test case that checks both cases: - multiple table maps with the same identifier - multiple table maps with the same identifier, but only one is processed (the others are filtered out) added: mysql-test/suite/rpl/r/rpl_row_corruption.result mysql-test/suite/rpl/t/rpl_row_corruption-slave.opt mysql-test/suite/rpl/t/rpl_row_corruption.test modified: sql/log_event.cc === modified file 'sql/protocol.cc' --- a/sql/protocol.cc 2011-06-30 15:37:13 +0000 +++ b/sql/protocol.cc 2011-07-15 10:31:01 +0000 @@ -857,8 +857,8 @@ bool Protocol_text::store(const char *fr { CHARSET_INFO *tocs= this->thd->variables.character_set_results; #ifndef DBUG_OFF - DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos, - field_count, (length == 0? "" : from))); + DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %.*s", field_pos, + field_count, (int) length, (length == 0 ? "" : from))); DBUG_ASSERT(field_pos < field_count); DBUG_ASSERT(field_types == 0 || field_types[field_pos] == MYSQL_TYPE_DECIMAL || No bundle (reason: useless for push emails).