#At file:///home/bzr/6.0-bugteam/ based on revid:mats@stripped
2967 Mats Kindahl 2009-01-14 [merge]
Merging with 6.0-bugteam.
modified:
mysql-test/extra/rpl_tests/rpl_auto_increment.test
mysql-test/suite/rpl/r/rpl_auto_increment.result
sql/log_event.cc
=== modified file 'mysql-test/extra/rpl_tests/rpl_auto_increment.test'
--- a/mysql-test/extra/rpl_tests/rpl_auto_increment.test 2007-06-06 17:57:07 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_auto_increment.test 2009-01-14 08:27:32 +0000
@@ -145,6 +145,23 @@ select * from t3 order by a;
connection master;
drop table t1,t2,t3;
+sync_slave_with_master;
+
+#
+# BUG#41986 Replication slave does not pick up proper AUTO_INCREMENT value for Innodb tables
+#
+connection master;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+
+sync_slave_with_master;
+show create table t1;
+
+connection master;
+drop table t1;
# End cleanup
sync_slave_with_master;
=== modified file 'mysql-test/suite/rpl/r/rpl_auto_increment.result'
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result 2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result 2009-01-14 08:27:32 +0000
@@ -227,3 +227,20 @@ select * from t3 order by a;
a
127
drop table t1,t2,t3;
+set auto_increment_increment=1;
+set auto_increment_offset=1;
+CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
+INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+drop table t1;
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2009-01-09 12:31:08 +0000
+++ b/sql/log_event.cc 2009-01-14 10:05:29 +0000
@@ -8181,7 +8181,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;
}
@@ -8190,6 +8192,7 @@ Write_rows_log_event::do_after_row_opera
int error)
{
int local_error= 0;
+ m_table->next_number_field=0;
if (bit_is_set(slave_exec_mode, SLAVE_EXEC_MODE_IDEMPOTENT) == 1 ||
m_table->s->db_type()->db_type == DB_TYPE_NDBCLUSTER)
{
| Thread |
|---|
| • bzr commit into mysql-6.0-bugteam branch (mats:2967) | Mats Kindahl | 14 Jan |