Loading mysql-test/r/rpl_insert_id.result +5 −0 Original line number Diff line number Diff line Loading @@ -68,3 +68,8 @@ b c 9 13 drop table t1; drop table t2; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Duplicate entry '1' for key 1 mysql-test/t/rpl_insert_id.test +16 −0 Original line number Diff line number Diff line Loading @@ -61,3 +61,19 @@ drop table t2; save_master_pos; connection slave; sync_with_master; # # Bug#8412: Error codes reported in binary log for CHARACTER SET, # FOREIGN_KEY_CHECKS # connection master; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; --error 1062 INSERT INTO t1 VALUES (1),(1); sync_slave_with_master; sql/log.cc +13 −1 Original line number Diff line number Diff line Loading @@ -1389,6 +1389,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", p= strmov(strmov(buf, "SET CHARACTER SET "), thd->variables.convert_set->name); Query_log_event e(thd, buf, (ulong) (p - buf), 0); e.error_code = 0; // This statement cannot fail (see [1]). e.set_log_pos(this); if (e.write(file)) goto err; Loading @@ -1407,12 +1408,22 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE); e.set_log_pos(this); e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } } /* Write the SQL command */ /* Write the SQL command [1] If this statement has an error code, the slave is required to fail with the same error code or stop. The preamble and epilogue should *not* have this error code since the execution of those is guaranteed *not* to produce any error code. This would therefore stop the slave even if the execution of the real statement can be handled gracefully by the slave. */ event_info->set_log_pos(this); if (event_info->write(file)) Loading @@ -1426,6 +1437,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE); e.set_log_pos(this); e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } Loading Loading
mysql-test/r/rpl_insert_id.result +5 −0 Original line number Diff line number Diff line Loading @@ -68,3 +68,8 @@ b c 9 13 drop table t1; drop table t2; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); Duplicate entry '1' for key 1
mysql-test/t/rpl_insert_id.test +16 −0 Original line number Diff line number Diff line Loading @@ -61,3 +61,19 @@ drop table t2; save_master_pos; connection slave; sync_with_master; # # Bug#8412: Error codes reported in binary log for CHARACTER SET, # FOREIGN_KEY_CHECKS # connection master; SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; --error 1062 INSERT INTO t1 VALUES (1),(1); sync_slave_with_master;
sql/log.cc +13 −1 Original line number Diff line number Diff line Loading @@ -1389,6 +1389,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", p= strmov(strmov(buf, "SET CHARACTER SET "), thd->variables.convert_set->name); Query_log_event e(thd, buf, (ulong) (p - buf), 0); e.error_code = 0; // This statement cannot fail (see [1]). e.set_log_pos(this); if (e.write(file)) goto err; Loading @@ -1407,12 +1408,22 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE); e.set_log_pos(this); e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } } /* Write the SQL command */ /* Write the SQL command [1] If this statement has an error code, the slave is required to fail with the same error code or stop. The preamble and epilogue should *not* have this error code since the execution of those is guaranteed *not* to produce any error code. This would therefore stop the slave even if the execution of the real statement can be handled gracefully by the slave. */ event_info->set_log_pos(this); if (event_info->write(file)) Loading @@ -1426,6 +1437,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE); e.set_log_pos(this); e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } Loading