#At file:///media/sdb2/hezx/work/mysql/bzrwork/b41986/5.1-bugteam/
2747 He Zhenxing 2009-01-13
BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
The next number (AUTO_INCREMENT) field of the table for write
rows events are not initialized, and cause some engines (innodb)
not correctly update the tables's auto_increment value.
This patch fixed this problem by honor next number fields if present.
modified:
sql/log_event.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2009-01-05 16:10:20 +0000
+++ b/sql/log_event.cc 2009-01-13 04:43:41 +0000
@@ -8091,6 +8091,9 @@ Write_rows_log_event::do_before_row_oper
analyze if explicit data is provided for slave's TIMESTAMP columns).
*/
m_table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET;
+
+ /* Honor next number column if present */
+ m_table->next_number_field= m_table->found_next_number_field;
return error;
}