diff options
Diffstat (limited to 'mysql-test/suite/binlog/r')
17 files changed, 463 insertions, 70 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index 33feb5c7591..f84995cac3b 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -35,7 +35,7 @@ DELIMITER /*!*/; # at 4 <#>ROLLBACK/*!*/; # at 102 -<#>use test/*!*/; +<#>use `test`/*!*/; SET TIMESTAMP=1196959712/*!*/; <#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result new file mode 100644 index 00000000000..8a4a3af115d --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result @@ -0,0 +1,88 @@ +SET @old_max_binlog_size= @@global.max_binlog_size; +SET GLOBAL max_binlog_size= 4096; +SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +CREATE TABLE t2 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Myisam; +*** Test that RESET MASTER waits for pending commit checkpoints to complete. +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go"; +INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +INSERT INTO t2 VALUES (1, REPEAT("x", 4100)); +INSERT INTO t2 VALUES (2, REPEAT("x", 4100)); +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "execute_command_after_close_tables SIGNAL reset_master_done"; +RESET MASTER; +This will timeout, as RESET MASTER is blocked +SET DEBUG_SYNC= "now WAIT_FOR reset_master_done TIMEOUT 1"; +Warnings: +Warning 1639 debug sync point wait timed out +SET DEBUG_SYNC= "now SIGNAL con1_go"; +show binary logs; +Log_name File_size +master-bin.000001 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 +*** Test that binlog N is active, and commit checkpoint for (N-1) is +*** done while there is still a pending commit checkpoint for (N-2). +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_continue"; +INSERT INTO t1 VALUES (20, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR con2_continue"; +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Rotate # # master-bin.000002;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000002 # Binlog_checkpoint # # master-bin.000001 +master-bin.000002 # Query # # BEGIN +master-bin.000002 # Table_map # # table_id: # (test.t1) +master-bin.000002 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000002 # Xid # # COMMIT /* XID */ +master-bin.000002 # Rotate # # master-bin.000003;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "now SIGNAL con2_continue"; +con1 is still pending, no new binlog checkpoint should have been logged. +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +SET DEBUG_SYNC= "now SIGNAL con1_continue"; +No commit checkpoints are pending, a new binlog checkpoint should have been logged. +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000001 +master-bin.000003 # Binlog_checkpoint # # master-bin.000003 +DROP TABLE t1, t2; +SET GLOBAL max_binlog_size= @old_max_binlog_size; +SET GLOBAL innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit; diff --git a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result index e461a37c58b..0acd39388cd 100644 --- a/mysql-test/suite/binlog/r/binlog_drop_if_exists.result +++ b/mysql-test/suite/binlog/r/binlog_drop_if_exists.result @@ -96,3 +96,21 @@ master-bin.000001 # Query # # use `test`; DROP VIEW IF EXISTS db_bug_13684.v master-bin.000001 # Query # # use `test`; DROP EVENT IF EXISTS db_bug_13684.e master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `db_bug_13684`.`t` /* generated by server */ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db_bug_13684 +CREATE TABLE t1(id int); +DROP TABLE /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* comment */ t1; +CREATE TABLE t1(id int); +DROP TABLE /**/ t1; +CREATE TABLE t1(id int); +DROP TABLE IF EXISTS /* */ t1; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* comment */ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE /**/ `t1` /* generated by server */ +master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id int) +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS /* */ `t1` /* generated by server */ diff --git a/mysql-test/suite/binlog/r/binlog_innodb_row.result b/mysql-test/suite/binlog/r/binlog_innodb_row.result index 4f1ee073b6d..468a3dd5bd9 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb_row.result +++ b/mysql-test/suite/binlog/r/binlog_innodb_row.result @@ -69,6 +69,8 @@ INSERT INTO t1 VALUES (1); START TRANSACTION; INSERT INTO t2 VALUES (1); INSERT IGNORE INTO t1 VALUES (1); +Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' COMMIT; INSERT INTO t1 VALUES (2); START TRANSACTION; diff --git a/mysql-test/suite/binlog/r/binlog_ioerr.result b/mysql-test/suite/binlog/r/binlog_ioerr.result index f8e2d189f57..68ff5264aa3 100644 --- a/mysql-test/suite/binlog/r/binlog_ioerr.result +++ b/mysql-test/suite/binlog/r/binlog_ioerr.result @@ -16,6 +16,7 @@ a SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info BINLOG POS Format_desc 1 ENDPOS Server ver: #, Binlog ver: # +BINLOG POS Binlog_checkpoint 1 ENDPOS master-bin.000001 BINLOG POS Query 1 ENDPOS use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb BINLOG POS Query 1 ENDPOS BEGIN BINLOG POS Query 1 ENDPOS use `test`; INSERT INTO t1 VALUES(0) diff --git a/mysql-test/suite/binlog/r/binlog_mdev342.result b/mysql-test/suite/binlog/r/binlog_mdev342.result index 9cb2b94f59d..0d45cbace91 100644 --- a/mysql-test/suite/binlog/r/binlog_mdev342.result +++ b/mysql-test/suite/binlog/r/binlog_mdev342.result @@ -21,6 +21,7 @@ master-bin.000002 # include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000001 # Binlog_checkpoint # # master-bin.000001 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result index 0c008661784..58cac276c95 100644 --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result @@ -8,6 +8,7 @@ ##################################################################################### show binlog events in 'master-bin.000001' from <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test1 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test2 master-bin.000001 # Query 1 # DROP DATABASE IF EXISTS test3 @@ -67,6 +68,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -293,6 +296,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -437,6 +442,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -653,6 +660,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -879,6 +888,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -1023,6 +1034,8 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result index b162e66137b..58ec82cbb3a 100644 --- a/mysql-test/suite/binlog/r/binlog_row_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result @@ -234,6 +234,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; @@ -578,13 +579,46 @@ DROP PROCEDURE p4; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); +insert into t1 values(5); set insert_id=128; -insert into t1 values(null); +insert into t1 values(null) /* Not binlogged */; +ERROR 22003: Out of range value for column 'id' at row 1 +set insert_id=128; +insert ignore into t1 values(null) /* Insert 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 1 +set insert_id=5; +insert into t1 values(null) /* Not binlogged */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(null) /* Insert 5 */; Warnings: -Warning 1264 Out of range value for column 'id' at row 1 +Warning 1062 Duplicate entry '5' for key 'PRIMARY' select * from t1; id -127 +5 +drop table t1; +create table t1 (id tinyint auto_increment primary key) engine=myisam; +set insert_id=128; +insert into t1 values(5),(null) /* Insert_id 128 */; +ERROR 22003: Out of range value for column 'id' at row 2 +set insert_id=128; +insert ignore into t1 values (4),(null) /* Insert_id 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 2 +set insert_id=5; +insert into t1 values(3),(null) /* Insert_id 5 */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(2),(null) /* Insert_id 5 */; +Warnings: +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +select * from t1 order by id; +id +2 +3 +4 +5 drop table t1; create table t1 (a int); create table if not exists t2 select * from t1; @@ -603,36 +637,19 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) engine=myisam master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( - `a` int(11) DEFAULT NULL -) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( - `a` int(11) DEFAULT NULL -) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (mysql.user) -master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -drop table t1,t2,t3,tt1; -create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert /* before delayed */ delayed /* after delayed */ into t1 values (207); -insert /*! delayed */ into t1 values (null); -insert delayed into t1 values (300); -FLUSH TABLES; -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -659,8 +676,15 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (mysql.user) master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ +drop table t1,t2,t3,tt1; +reset master; +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); +insert delayed into t1 values (300); +FLUSH TABLES; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -728,6 +752,7 @@ BINLOG ' SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info # # Format_desc 1 # Server ver: #, Binlog ver: # +# # Binlog_checkpoint 1 # master-bin.000001 # # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) # # Query 1 # BEGIN # # Table_map 1 # table_id: # (test.t1) diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result index d4a3503b1f2..55f4154574b 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result +++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result @@ -35,7 +35,9 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -72,7 +74,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -115,7 +117,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) @@ -229,7 +231,9 @@ DELIMITER /*!*/; #010909 4:46:40 server id # end_log_pos # Start: binlog v 4, server v #.##.## created 010909 4:46:40 at startup ROLLBACK/*!*/; # at # -use new_test1/*!*/; +#010909 4:46:40 server id # end_log_pos # Binlog checkpoint master-bin.000001 +# at # +use `new_test1`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; SET @@session.pseudo_thread_id=#/*!*/; @@ -266,7 +270,7 @@ COMMIT /*!*/; # at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 -use test2/*!*/; +use `test2`/*!*/; SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t2 (a INT) /*!*/; @@ -309,7 +313,7 @@ SET TIMESTAMP=1000000000/*!*/; COMMIT /*!*/; # at # -use new_test3/*!*/; +use `new_test3`/*!*/; #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; CREATE TABLE t3 (a INT) diff --git a/mysql-test/suite/binlog/r/binlog_server_id.result b/mysql-test/suite/binlog/r/binlog_server_id.result index f7d778a288b..34e32c8a29f 100644 --- a/mysql-test/suite/binlog/r/binlog_server_id.result +++ b/mysql-test/suite/binlog/r/binlog_server_id.result @@ -5,8 +5,9 @@ create table t1 (a int); select @@server_id; @@server_id 1 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) set global server_id=2; @@ -14,8 +15,9 @@ create table t2 (b int); select @@server_id; @@server_id 2 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 2 # use `test`; create table t2 (b int) @@ -24,8 +26,9 @@ create table t3 (c int); select @@server_id; @@server_id 3 -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; DROP TABLE IF EXISTS `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 2 # use `test`; create table t2 (b int) diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 1f4c138eb4e..344dddf78cf 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -1,3 +1,4 @@ +reset master; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; insert /* before delayed */ delayed /* after delayed */ into t1 values (207); insert /*! delayed */ into t1 values (null); @@ -5,9 +6,6 @@ insert delayed into t1 values (300); FLUSH TABLES; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci')) -master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert /* before delayed */ /* after delayed */ into t1 values (207) diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index fd6a98cabc4..06442245d3b 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -145,6 +145,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Rotate # # master-bin.000002;pos=POS include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000002 # Binlog_checkpoint # # master-bin.000002 master-bin.000002 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ set @ac = @@autocommit; set autocommit= 0; @@ -387,13 +388,46 @@ DROP PROCEDURE p4; End of 5.0 tests reset master; create table t1 (id tinyint auto_increment primary key); +insert into t1 values(5); set insert_id=128; -insert into t1 values(null); +insert into t1 values(null) /* Not binlogged */; +ERROR 22003: Out of range value for column 'id' at row 1 +set insert_id=128; +insert ignore into t1 values(null) /* Insert 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 1 +set insert_id=5; +insert into t1 values(null) /* Not binlogged */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(null) /* Insert 5 */; Warnings: -Warning 1264 Out of range value for column 'id' at row 1 +Warning 1062 Duplicate entry '5' for key 'PRIMARY' select * from t1; id -127 +5 +drop table t1; +create table t1 (id tinyint auto_increment primary key) engine=myisam; +set insert_id=128; +insert into t1 values(5),(null) /* Insert_id 128 */; +ERROR 22003: Out of range value for column 'id' at row 2 +set insert_id=128; +insert ignore into t1 values (4),(null) /* Insert_id 128 */; +Warnings: +Warning 167 Out of range value for column 'id' at row 2 +set insert_id=5; +insert into t1 values(3),(null) /* Insert_id 5 */; +ERROR 23000: Duplicate entry '5' for key 'PRIMARY' +set insert_id=5; +insert ignore into t1 values(2),(null) /* Insert_id 5 */; +Warnings: +Warning 1062 Duplicate entry '5' for key 'PRIMARY' +select * from t1 order by id; +id +2 +3 +4 +5 drop table t1; create table t1 (a int); create table if not exists t2 select * from t1; @@ -408,35 +442,33 @@ include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=127 -master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # use `test`; insert into t1 values(5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(null) /* Insert 128 */ +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(null) /* Insert 5 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ -master-bin.000001 # Query # # use `test`; create table t1 (a int) -master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 -master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) -master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) engine=myisam master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert into t1 values(5),(null) /* Insert_id 128 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Intvar # # INSERT_ID=128 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values (4),(null) /* Insert_id 128 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert into t1 values(3),(null) /* Insert_id 5 */ master-bin.000001 # Query # # COMMIT -drop table t1,t2,t3,tt1; -create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; -insert /* before delayed */ delayed /* after delayed */ into t1 values (207); -insert /*! delayed */ into t1 values (null); -insert delayed into t1 values (300); -FLUSH TABLES; -include/show_binlog_events.inc -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=127 -master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Intvar # # INSERT_ID=5 +master-bin.000001 # Query # # use `test`; insert ignore into t1 values(2),(null) /* Insert_id 5 */ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */ master-bin.000001 # Query # # use `test`; create table t1 (a int) @@ -452,8 +484,15 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `tt1` /* generated by server */ -master-bin.000001 # Query # # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ +drop table t1,t2,t3,tt1; +reset master; +create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; +insert /* before delayed */ delayed /* after delayed */ into t1 values (207); +insert /*! delayed */ into t1 values (null); +insert delayed into t1 values (300); +FLUSH TABLES; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -521,6 +560,7 @@ BINLOG ' SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info # # Format_desc 1 # Server ver: #, Binlog ver: # +# # Binlog_checkpoint 1 # master-bin.000001 # # Query 1 # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY) # # Query 1 # BEGIN # # Query 1 # use `test`; INSERT INTO t1 VALUES (1) diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index 755fd3e3761..2144a8bf649 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -173,8 +173,9 @@ set insert_id= 3; insert into t1 values (NULL), (33), (NULL); set insert_id= 5; insert into t1 values (55), (NULL); -show binlog events from <binlog_start>; +show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Binlog_checkpoint 1 # master-bin.000001 master-bin.000001 # Query 1 # use `test`; create table t1 (a int auto_increment, primary key (a)) engine=blackhole master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Intvar 1 # INSERT_ID=1 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index 796e6d0588f..cfeca4811cb 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -26,7 +26,7 @@ SET @@session.collation_database=DEFAULT/*!*/; BEGIN /*!*/; SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; -use test/*!*/; +use `test`/*!*/; SET TIMESTAMP=10000/*!*/; insert into t2 values (@v) /*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index d7148ea0293..b162323194b 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -700,7 +700,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK /* the output must denote there is the query */; drop trigger trg_del_t2; @@ -952,7 +952,7 @@ master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`= @b + bug27417(2) ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index b69dcb642b8..f192bae7ac0 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -2682,6 +2682,7 @@ CREATE TABLE insert_2_keys (a INT UNIQUE KEY, b INT UNIQUE KEY); INSERT INTO insert_2_keys values (1, 1); INSERT IGNORE INTO insert_table SELECT * FROM filler_table; Warnings: +Warning 1062 Duplicate entry '1' for key 'PRIMARY' Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave. TRUNCATE TABLE insert_table; INSERT INTO insert_table SELECT * FROM filler_table ON DUPLICATE KEY UPDATE a = 1; diff --git a/mysql-test/suite/binlog/r/binlog_xa_recover.result b/mysql-test/suite/binlog/r/binlog_xa_recover.result new file mode 100644 index 00000000000..1231a034ec6 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_xa_recover.result @@ -0,0 +1,198 @@ +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb; +INSERT INTO t1 VALUES (100, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (101, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (102, REPEAT("x", 4100)); +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (1, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con1_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (2, NULL); +SET DEBUG_SYNC= "now WAIT_FOR con2_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever"; +INSERT INTO t1 VALUES (3, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con3_wait"; +SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont"; +SET SESSION debug_dbug="+d,crash_commit_after_log"; +INSERT INTO t1 VALUES (4, NULL); +SET DEBUG_SYNC= "now WAIT_FOR con4_wait"; +SET DEBUG_SYNC= "now SIGNAL con1_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; +SET DEBUG_SYNC= "now SIGNAL con2_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con2_ready"; +SET DEBUG_SYNC= "now SIGNAL con3_cont"; +SET DEBUG_SYNC= "now WAIT_FOR con3_ready"; +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +master-bin.000005 # +master-bin.000006 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000003 # Binlog_checkpoint # # master-bin.000002 +master-bin.000003 # Binlog_checkpoint # # master-bin.000003 +master-bin.000003 # Query # # BEGIN +master-bin.000003 # Table_map # # table_id: # (test.t1) +master-bin.000003 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000003 # Xid # # COMMIT /* XID */ +master-bin.000003 # Rotate # # master-bin.000004;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000003 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Rotate # # master-bin.000005;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000005 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000005 # Binlog_checkpoint # # master-bin.000004 +master-bin.000005 # Query # # BEGIN +master-bin.000005 # Table_map # # table_id: # (test.t1) +master-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000005 # Xid # # COMMIT /* XID */ +master-bin.000005 # Query # # BEGIN +master-bin.000005 # Table_map # # table_id: # (test.t1) +master-bin.000005 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000005 # Xid # # COMMIT /* XID */ +master-bin.000005 # Rotate # # master-bin.000006;pos=POS +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000006 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000006 # Binlog_checkpoint # # master-bin.000004 +PURGE BINARY LOGS TO "master-bin.000006"; +show binary logs; +Log_name File_size +master-bin.000004 # +master-bin.000005 # +master-bin.000006 # +SET DEBUG_SYNC= "now SIGNAL con4_cont"; +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +100 +101 +102 +Test that with multiple binlog checkpoints, recovery starts from the last one. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont"; +INSERT INTO t1 VALUES (10, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con10_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont"; +INSERT INTO t1 VALUES (11, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con11_ready"; +SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont"; +INSERT INTO t1 VALUES (12, REPEAT("x", 4100)); +SET DEBUG_SYNC= "now WAIT_FOR con12_ready"; +INSERT INTO t1 VALUES (13, NULL); +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +SET DEBUG_SYNC= "now SIGNAL con10_cont"; +SET DEBUG_SYNC= "now SIGNAL con12_cont"; +SET DEBUG_SYNC= "now SIGNAL con11_cont"; +Checking that master-bin.000004 is the last binlog checkpoint +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000001 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Binlog_checkpoint # # master-bin.000002 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +Now crash the server +SET SESSION debug_dbug="+d,crash_commit_after_log"; +INSERT INTO t1 VALUES (14, NULL); +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +10 +11 +12 +13 +14 +100 +101 +102 +*** Check that recovery works if we crashed early during rotate, before +*** binlog checkpoint event could be written. +SET GLOBAL max_binlog_size= 4096; +SET GLOBAL innodb_flush_log_at_trx_commit= 1; +RESET MASTER; +INSERT INTO t1 VALUES (21, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (22, REPEAT("x", 4100)); +INSERT INTO t1 VALUES (23, REPEAT("x", 4100)); +SET SESSION debug_dbug="+d,crash_before_write_checkpoint_event"; +INSERT INTO t1 VALUES (24, REPEAT("x", 4100)); +Got one of the listed errors +SELECT a FROM t1 ORDER BY a; +a +1 +2 +3 +4 +10 +11 +12 +13 +14 +21 +22 +23 +24 +100 +101 +102 +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +master-bin.000005 # +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000004 # Format_desc # # SERVER_VERSION, BINLOG_VERSION +master-bin.000004 # Binlog_checkpoint # # master-bin.000003 +master-bin.000004 # Binlog_checkpoint # # master-bin.000004 +master-bin.000004 # Query # # BEGIN +master-bin.000004 # Table_map # # table_id: # (test.t1) +master-bin.000004 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000004 # Xid # # COMMIT /* XID */ +master-bin.000004 # Rotate # # master-bin.000005;pos=POS +DROP TABLE t1; |