
#At lp:maria/5.2 2760 knielsen@knielsen-hq.org 2010-05-23 [merge] Automerge Alexi's last fixes for Buildbot test. removed: mysql-test/t/mysqlbinlog-master.opt modified: mysql-test/extra/rpl_tests/rpl_row_annotate.test mysql-test/r/ctype_cp932_binlog_stm.result mysql-test/r/flush_block_commit_notembedded.result mysql-test/r/multi_update.result mysql-test/r/mysqlbinlog.result mysql-test/r/sp_trans_log.result mysql-test/suite/binlog/r/binlog_row_annotate.result mysql-test/suite/binlog/t/binlog_row_annotate.test mysql-test/suite/maria/r/maria-connect.result mysql-test/suite/maria/t/maria-connect.test mysql-test/suite/rpl/r/rpl_rotate_logs.result mysql-test/suite/rpl/r/rpl_row_annotate_do.result mysql-test/suite/rpl/r/rpl_row_annotate_dont.result mysql-test/t/ctype_cp932_binlog_stm.test mysql-test/t/flush_block_commit_notembedded.test mysql-test/t/multi_update.test mysql-test/t/mysqlbinlog.test mysql-test/t/mysqlbinlog2.test mysql-test/t/sp_trans_log.test === modified file 'mysql-test/extra/rpl_tests/rpl_row_annotate.test' --- a/mysql-test/extra/rpl_tests/rpl_row_annotate.test 2010-05-07 10:04:20 +0000 +++ b/mysql-test/extra/rpl_tests/rpl_row_annotate.test 2010-05-23 08:40:25 +0000 @@ -160,13 +160,28 @@ if (!$annotate) --echo # No Annotate_rows events should appear below } --echo ######################################################################## -#FLUSH LOGS; -let $start_pos= `select @binlog_start_pos`; ---replace_column 2 # 5 # ---replace_result $start_pos <start_pos> ---replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// ---eval show binlog events in 'slave-bin.000002' from $start_pos +# We cannot SHOW all events after executing INSERT DELAYED that inserts +# multiple rows: the inserted rows may be written in batches to the binlog, +# with each batch containing one Table map and one or more Write_rows events; +# the number of rows included in each batch is nondeterministic and this +# will make the test unstable. Instead we show only pairs: +# <Annotate event, first subsequent Table_map event>. + +--exec $MYSQL --port=$SLAVE_MYPORT test -e "show binlog events in 'slave-bin.000002'" > $MYSQLTEST_VARDIR/tmp/annotated_events.txt +perl; + open F, '<', "$ENV{MYSQLTEST_VARDIR}/tmp/annotated_events.txt" or die; + binmode STDOUT; + while (defined ($_ = <F>)) { + if (/Annotate_rows/) { + s/[0-9]+\sAnnotate_rows\s[0-9]+\s[0-9]+/# Annotate_rows # #/; + print($_); + $_ = <F>; + s/[0-9]+\sTable_map\s[0-9]+\s[0-9]+\stable_id:\s[0-9]+/# Table_map # # table_id: #/; + print($_); + } + } +EOF # Clean-up connection master; === modified file 'mysql-test/r/ctype_cp932_binlog_stm.result' --- a/mysql-test/r/ctype_cp932_binlog_stm.result 2009-06-25 08:44:50 +0000 +++ b/mysql-test/r/ctype_cp932_binlog_stm.result 2010-05-23 08:40:25 +0000 @@ -29,22 +29,23 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 370| +SHOW BINLOG EVENTS FROM <start_pos>;| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 370 Query 1 536 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 # Query 1 # use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 536 Query 1 785 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), +master-bin.000001 # Query 1 # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 785 Query 1 1049 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) -master-bin.000001 1049 Query 1 1138 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1138 Query 1 1217 use `test`; DROP TABLE t4 +master-bin.000001 # Query 1 # use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) +master-bin.000001 # Query 1 # use `test`; DROP PROCEDURE bug18293 +master-bin.000001 # Query 1 # use `test`; DROP TABLE t4 End of 5.0 tests -SHOW BINLOG EVENTS FROM 365; +CALL mtr.add_suppression("'Found invalid event in binary log', data_len: 258, event_type: 49"); +SHOW BINLOG EVENTS FROM <start_pos>; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. CREATE TABLE t1 (a varchar(16)) character set cp932; === modified file 'mysql-test/r/flush_block_commit_notembedded.result' --- a/mysql-test/r/flush_block_commit_notembedded.result 2009-03-06 14:56:17 +0000 +++ b/mysql-test/r/flush_block_commit_notembedded.result 2010-05-23 08:40:25 +0000 @@ -9,13 +9,13 @@ INSERT t1 VALUES (1); FLUSH TABLES WITH READ LOCK; SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +master-bin.000001 # # Switch to connection con1 COMMIT; # Switch to connection con2 SHOW MASTER STATUS; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 106 +master-bin.000001 # UNLOCK TABLES; # Switch to connection con1 DROP TABLE t1; === modified file 'mysql-test/r/multi_update.result' --- a/mysql-test/r/multi_update.result 2009-03-05 10:23:46 +0000 +++ b/mysql-test/r/multi_update.result 2010-05-23 08:40:25 +0000 @@ -604,7 +604,7 @@ a b 4 4 show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 206 +master-bin.000001 # delete from t1; delete from t2; insert into t1 values (1,2),(3,4),(4,4); @@ -614,7 +614,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t ERROR 23000: Duplicate entry '4' for key 'PRIMARY' show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 221 +master-bin.000001 # drop table t1, t2; set @@session.binlog_format= @sav_binlog_format; drop table if exists t1, t2, t3; === modified file 'mysql-test/r/mysqlbinlog.result' --- a/mysql-test/r/mysqlbinlog.result 2010-01-27 12:23:28 +0000 +++ b/mysql-test/r/mysqlbinlog.result 2010-05-23 08:40:25 +0000 @@ -1,15 +1,17 @@ reset master; +SET @save_binlog_size= @@global.max_binlog_size; +SET @@global.max_binlog_size= 4096; set timestamp=1000000000; drop table if exists t1,t2,t3,t4,t5,t03,t04; create table t1 (word varchar(20)); create table t2 (id int auto_increment not null primary key); insert into t1 values ("abirvalg"); insert into t2 values (); -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; insert into t1 values ("Alas"); flush logs; @@ -255,6 +257,7 @@ DELIMITER ; ROLLBACK /* added by mysqlbinlog */; /*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/; drop table t1,t2; +SET @@global.max_binlog_size= @save_binlog_size; flush logs; flush logs; select * from t5 /* must be (1),(1) */; === modified file 'mysql-test/r/sp_trans_log.result' --- a/mysql-test/r/sp_trans_log.result 2007-12-14 13:40:45 +0000 +++ b/mysql-test/r/sp_trans_log.result 2010-05-23 08:40:25 +0000 @@ -14,7 +14,7 @@ end| reset master| insert into t2 values (bug23333(),1)| ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -show binlog events from 106 /* with fixes for #23333 will show there is the query */| +show binlog events from <start_pos>; /* with fixes for #23333 will show there is the query */| Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # # master-bin.000001 # Table_map 1 # # === modified file 'mysql-test/suite/binlog/r/binlog_row_annotate.result' --- a/mysql-test/suite/binlog/r/binlog_row_annotate.result 2010-04-13 05:59:14 +0000 +++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result 2010-05-23 08:40:25 +0000 @@ -1,7 +1,7 @@ ##################################################################################### # The following Annotate_rows events should appear below: # - INSERT INTO test2.t2 VALUES (1), (2), (3) -# - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +# - INSERT INTO test3.t3 VALUES (1), (2), (3) # - DELETE test1.t1, test2.t2 FROM <...> # - INSERT INTO test2.t2 VALUES (1), (2), (3) # - DELETE xtest1.xt1, test2.t2 FROM <...> @@ -24,9 +24,7 @@ master-bin.000001 # Table_map 1 # table_ master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # BEGIN -master-bin.000001 # Annotate_rows 1 # INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) -master-bin.000001 # Table_map 1 # table_id: # (test3.t3) -master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Annotate_rows 1 # INSERT INTO test3.t3 VALUES (1), (2), (3) master-bin.000001 # Table_map 1 # table_id: # (test3.t3) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # COMMIT @@ -57,7 +55,7 @@ master-bin.000001 # Rotate 1 # master-bi # mysqlbinlog # The following Annotates should appear in this output: # - INSERT INTO test2.t2 VALUES (1), (2), (3) -# - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +# - INSERT INTO test3.t3 VALUES (1), (2), (3) # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps) # - INSERT INTO test2.t2 VALUES (1), (2), (3) # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) @@ -164,16 +162,12 @@ BEGIN # at # # at # #010909 4:46:40 server id # end_log_pos # Annotate_rows: -#Q> INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +#Q> INSERT INTO test3.t3 VALUES (1), (2), (3) #010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # -#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=2 /* INT meta=0 nullable=1 is_null=0 */ @@ -365,8 +359,6 @@ BEGIN # at # # at # # at # -# at # -# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; COMMIT @@ -542,10 +534,6 @@ BEGIN ### INSERT INTO test3.t3 ### SET ### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # -#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=2 /* INT meta=0 nullable=1 is_null=0 */ @@ -653,7 +641,7 @@ ROLLBACK /* added by mysqlbinlog */; # mysqlbinlog --read-from-remote-server # The following Annotates should appear in this output: # - INSERT INTO test2.t2 VALUES (1), (2), (3) -# - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +# - INSERT INTO test3.t3 VALUES (1), (2), (3) # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps) # - INSERT INTO test2.t2 VALUES (1), (2), (3) # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) @@ -760,16 +748,12 @@ BEGIN # at # # at # #010909 4:46:40 server id # end_log_pos # Annotate_rows: -#Q> INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +#Q> INSERT INTO test3.t3 VALUES (1), (2), (3) #010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # -#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=2 /* INT meta=0 nullable=1 is_null=0 */ @@ -961,8 +945,6 @@ BEGIN # at # # at # # at # -# at # -# at # #010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; COMMIT @@ -1136,10 +1118,6 @@ BEGIN ### INSERT INTO test3.t3 ### SET ### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id # end_log_pos # Table_map: `test3`.`t3` mapped to number # -#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test3.t3 ### SET ### @1=2 /* INT meta=0 nullable=1 is_null=0 */ === modified file 'mysql-test/suite/binlog/t/binlog_row_annotate.test' --- a/mysql-test/suite/binlog/t/binlog_row_annotate.test 2010-05-07 10:04:20 +0000 +++ b/mysql-test/suite/binlog/t/binlog_row_annotate.test 2010-05-23 08:40:25 +0000 @@ -61,10 +61,7 @@ INSERT INTO test1.t1 VALUES (1), (2), (3 SET SESSION binlog_annotate_rows_events = ON; INSERT INTO test2.t2 VALUES (1), (2), (3); - -# This query generates two Table maps and two Write_rows events -# but the Annotate event should appear only once before them -INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3); +INSERT INTO test3.t3 VALUES (1), (2), (3); # This query generates two Table maps but the Annotate # event should appear only once before the first Table map @@ -85,7 +82,7 @@ DELETE xtest1.xt1, test2.t2 # These events should be filtered out together with Annotate events INSERT INTO xtest1.xt1 VALUES (1), (2), (3); -INSERT DELAYED INTO xtest2.xt2 VALUES (1), (2), (3); +INSERT INTO xtest2.xt2 VALUES (1), (2), (3); DELETE xtest1.xt1, xtest2.xt2 FROM xtest1.xt1 INNER JOIN xtest2.xt2 INNER JOIN test3.t3 WHERE xtest1.xt1.a=xtest2.xt2.a AND xtest2.xt2.a=test3.t3.a; @@ -96,7 +93,7 @@ FLUSH LOGS; --echo ##################################################################################### --echo # The following Annotate_rows events should appear below: --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) ---echo # - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3) --echo # - DELETE test1.t1, test2.t2 FROM <...> --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) --echo # - DELETE xtest1.xt1, test2.t2 FROM <...> @@ -113,7 +110,7 @@ let $start_pos= `select @binlog_start_po --echo # mysqlbinlog --echo # The following Annotates should appear in this output: --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) ---echo # - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3) --echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps) --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) --echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) @@ -149,7 +146,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; --echo # mysqlbinlog --read-from-remote-server --echo # The following Annotates should appear in this output: --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) ---echo # - INSERT DELAYED INTO test3.t3 VALUES (1), (2), (3) +--echo # - INSERT INTO test3.t3 VALUES (1), (2), (3) --echo # - DELETE test1.t1, test2.t2 FROM <...> (with two subsequent Table maps) --echo # - INSERT INTO test2.t2 VALUES (1), (2), (3) --echo # - DELETE xtest1.xt1, test2.t2 FROM <...> (with one subsequent Table map) === modified file 'mysql-test/suite/maria/r/maria-connect.result' --- a/mysql-test/suite/maria/r/maria-connect.result 2009-02-12 14:08:56 +0000 +++ b/mysql-test/suite/maria/r/maria-connect.result 2010-05-23 08:40:25 +0000 @@ -14,10 +14,10 @@ a 2 3 4 -SHOW BINLOG EVENTS FROM 106; +SHOW BINLOG EVENTS FROM <start_pos>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 106 Query 1 204 use `test`; CREATE TABLE t1 (a int primary key) -master-bin.000001 204 Query 1 295 use `test`; insert t1 values (1),(2),(3) -master-bin.000001 295 Query 1 386 use `test`; insert t1 values (4),(2),(5) +master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a int primary key) +master-bin.000001 # Query 1 # use `test`; insert t1 values (1),(2),(3) +master-bin.000001 # Query 1 # use `test`; insert t1 values (4),(2),(5) drop table t1; set binlog_format=default; === modified file 'mysql-test/suite/maria/t/maria-connect.test' --- a/mysql-test/suite/maria/t/maria-connect.test 2009-02-19 09:01:25 +0000 +++ b/mysql-test/suite/maria/t/maria-connect.test 2010-05-23 08:40:25 +0000 @@ -4,6 +4,7 @@ -- source include/have_maria.inc -- source include/have_log_bin.inc +-- source include/binlog_start_pos.inc let $default=`select @@global.storage_engine`; set global storage_engine=maria; @@ -27,7 +28,10 @@ insert t1 values (1),(2),(3); --error ER_DUP_ENTRY insert t1 values (4),(2),(5); select * from t1; -SHOW BINLOG EVENTS FROM 106; +--replace_column 2 # 5 # +--replace_result $binlog_start_pos <start_pos> +--eval SHOW BINLOG EVENTS FROM $binlog_start_pos + drop table t1; set binlog_format=default; === modified file 'mysql-test/suite/rpl/r/rpl_rotate_logs.result' --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result 2009-03-12 09:48:41 +0000 +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result 2010-05-23 08:40:25 +0000 @@ -40,7 +40,7 @@ Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File -Until_Log_Pos 0 +Until_Log_Pos # Master_SSL_Allowed No Master_SSL_CA_File Master_SSL_CA_Path @@ -119,7 +119,7 @@ Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File -Until_Log_Pos 0 +Until_Log_Pos # Master_SSL_Allowed No Master_SSL_CA_File Master_SSL_CA_Path @@ -183,7 +183,7 @@ Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File -Until_Log_Pos 0 +Until_Log_Pos # Master_SSL_Allowed No Master_SSL_CA_File Master_SSL_CA_Path === modified file 'mysql-test/suite/rpl/r/rpl_row_annotate_do.result' --- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result 2010-05-07 10:04:20 +0000 +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result 2010-05-23 08:40:25 +0000 @@ -180,32 +180,7 @@ a b # - INSERT DELAYED INTO t4 VALUES (1,1), (2,2), (3,3) # - INSERT DELAYED INTO t4 VALUES (4,4), (5,5), (6,6) ######################################################################## -show binlog events in 'slave-bin.000002' from <start_pos>; -Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Annotate_rows 1 # INSERT DELAYED INTO test1.t4 VALUES (1,1), (2,2), (3,3) -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Annotate_rows 1 # INSERT DELAYED INTO test1.t4 VALUES (4,4), (5,5), (6,6) -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # use `test1`; FLUSH TABLE t4 +slave-bin.000002 # Annotate_rows # # INSERT DELAYED INTO test1.t4 VALUES (1,1), (2,2), (3,3) +slave-bin.000002 # Table_map # # table_id: # (test1.t4) +slave-bin.000002 # Annotate_rows # # INSERT DELAYED INTO test1.t4 VALUES (4,4), (5,5), (6,6) +slave-bin.000002 # Table_map # # table_id: # (test1.t4) === modified file 'mysql-test/suite/rpl/r/rpl_row_annotate_dont.result' --- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result 2010-05-07 10:04:20 +0000 +++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result 2010-05-23 08:40:25 +0000 @@ -160,30 +160,3 @@ a b # EVENTS ON SLAVE # No Annotate_rows events should appear below ######################################################################## -show binlog events in 'slave-bin.000002' from <start_pos>; -Log_name Pos Event_type Server_id End_log_pos Info -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # BEGIN -slave-bin.000002 # Table_map 1 # table_id: # (test1.t4) -slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F -slave-bin.000002 # Query 1 # COMMIT -slave-bin.000002 # Query 1 # use `test1`; FLUSH TABLE t4 === modified file 'mysql-test/t/ctype_cp932_binlog_stm.test' --- a/mysql-test/t/ctype_cp932_binlog_stm.test 2009-06-25 08:44:50 +0000 +++ b/mysql-test/t/ctype_cp932_binlog_stm.test 2010-05-23 08:40:25 +0000 @@ -3,6 +3,7 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/ctype_cp932_binlog.test +-- source include/binlog_start_pos.inc # # Bug#18293: Values in stored procedure written to binlog unescaped @@ -22,18 +23,26 @@ CALL bug18293("Foo's a Bar", _cp932 0xED SELECT HEX(s1),HEX(s2),d FROM t4| DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 370| +### SHOW BINLOG EVENTS FROM 504| +--let $start_pos= `select @binlog_start_pos + 264` +--replace_result $start_pos <start_pos> +--replace_column 2 # 5 # +eval SHOW BINLOG EVENTS FROM $start_pos;| delimiter ;| --echo End of 5.0 tests # # #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump -# Note: 364 is a magic position (found experimentally, depends on -# the log's contents) that caused the server crash. +# Note: @binlog_start_pos + 259 is a magic position (found experimentally, +# depends on the log's contents) that caused the server crash. +CALL mtr.add_suppression("'Found invalid event in binary log', data_len: 258, event_type: 49"); + +--let $start_pos= `select @binlog_start_pos + 259` +--replace_result $start_pos <start_pos> --error 1220 -SHOW BINLOG EVENTS FROM 365; +eval SHOW BINLOG EVENTS FROM $start_pos; --echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. CREATE TABLE t1 (a varchar(16)) character set cp932; @@ -42,3 +51,4 @@ SELECT hex(a), hex(lower(a)), hex(upper( DROP TABLE t1; --echo End of 5.1 tests + === modified file 'mysql-test/t/flush_block_commit_notembedded.test' --- a/mysql-test/t/flush_block_commit_notembedded.test 2009-03-06 14:56:17 +0000 +++ b/mysql-test/t/flush_block_commit_notembedded.test 2010-05-23 08:40:25 +0000 @@ -28,6 +28,7 @@ INSERT t1 VALUES (1); --echo # Switch to connection con2 connection con2; FLUSH TABLES WITH READ LOCK; +--replace_column 2 # SHOW MASTER STATUS; --echo # Switch to connection con1 connection con1; @@ -35,6 +36,7 @@ send COMMIT; --echo # Switch to connection con2 connection con2; sleep 1; +--replace_column 2 # SHOW MASTER STATUS; UNLOCK TABLES; --echo # Switch to connection con1 === modified file 'mysql-test/t/multi_update.test' --- a/mysql-test/t/multi_update.test 2009-10-28 07:52:34 +0000 +++ b/mysql-test/t/multi_update.test 2010-05-23 08:40:25 +0000 @@ -589,6 +589,7 @@ reset master; UPDATE t2,t1 SET t2.a=t1.a+2; # check select * from t2 /* must be (3,1), (4,4) */; +--replace_column 2 # show master status /* there must be the UPDATE query event */; # B. testing multi_update::send_error() ineffective update @@ -600,6 +601,7 @@ insert into t2 values (1,2),(3,4),(4,4); reset master; --error ER_DUP_ENTRY UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; +--replace_column 2 # show master status /* there must be the UPDATE query event */; # cleanup === removed file 'mysql-test/t/mysqlbinlog-master.opt' --- a/mysql-test/t/mysqlbinlog-master.opt 2003-09-24 19:25:58 +0000 +++ b/mysql-test/t/mysqlbinlog-master.opt 1970-01-01 00:00:00 +0000 @@ -1 +0,0 @@ ---max-binlog-size=4096 === modified file 'mysql-test/t/mysqlbinlog.test' --- a/mysql-test/t/mysqlbinlog.test 2009-12-06 01:11:32 +0000 +++ b/mysql-test/t/mysqlbinlog.test 2010-05-23 08:40:25 +0000 @@ -3,10 +3,18 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source include/have_log_bin.inc +-- source include/binlog_start_pos.inc # Deletes all the binary logs reset master; +# We need small binlog size to break the last LOAD DATA INFILE below so that +# the corresponding Begin_load_query will be written to master-bin.000001 +# while the Execute_load_query will be written to master-bin.000002. + +SET @save_binlog_size= @@global.max_binlog_size; +SET @@global.max_binlog_size= 4096; + # we need this for getting fixed timestamps inside of this test set timestamp=1000000000; @@ -26,13 +34,15 @@ insert into t2 values (); # test for load data and load data distributed among the several # files (we need to fill up first binlog) -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; -load data infile '../../std_data/words.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; +load data infile '../../std_data/words3.dat' into table t1; # simple query to show more in second binlog insert into t1 values ("Alas"); + +### Starting master-bin.000003 flush logs; # delimiters are for easier debugging in future @@ -69,10 +79,10 @@ select "--- --database --" as ""; --disable_query_log select "--- --position --" as ""; --enable_query_log +let $start_pos= `select @binlog_start_pos + 227`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=332 $MYSQLD_DATADIR/master-bin.000002 - +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=$start_pos $MYSQLD_DATADIR/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -106,9 +116,10 @@ select "--- --database --" as ""; --disable_query_log select "--- --position --" as ""; --enable_query_log +let $start_pos= `select @binlog_start_pos + 227`; --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=332 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=$start_pos --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # Bug#7853 mysqlbinlog does not accept input from stdin --disable_query_log @@ -123,10 +134,14 @@ select "--- reading stdin --" as ""; --exec $MYSQL_BINLOG --short-form --position=79 - < $MYSQL_TEST_DIR/std_data/trunc_binlog.000001 drop table t1,t2; +SET @@global.max_binlog_size= @save_binlog_size; + # # Bug#14157 utf8 encoding in binlog without set character_set_client # +### Starting master-bin.000004 flush logs; + --write_file $MYSQLTEST_VARDIR/tmp/bug14157.sql create table if not exists t5 (a int); set names latin1; @@ -140,6 +155,8 @@ EOF # resulted binlog, parly consisting of multi-byte utf8 chars, # must be digestable for both client and server. In 4.1 the client # should use default-character-set same as the server. + +### Starting master-bin.000005 flush logs; --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000004 | $MYSQL select * from t5 /* must be (1),(1) */; @@ -150,6 +167,8 @@ drop table t5; # Check that a dump created by mysqlbinlog reproduces # lc_time_names dependent values correctly # + +### Starting master-bin.000006 flush logs; create table t5 (c1 int, c2 varchar(128) character set latin1 not null); insert into t5 values (1, date_format('2001-01-01','%W')); @@ -158,7 +177,10 @@ insert into t5 values (2, date_format('2 set lc_time_names=en_US; insert into t5 values (3, date_format('2001-01-01','%W')); select * from t5 order by c1; + +### Starting master-bin.000007 flush logs; + drop table t5; --exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000006 | $MYSQL select * from t5 order by c1; @@ -170,7 +192,10 @@ drop table t5; --disable_warnings drop procedure if exists p1; --enable_warnings + +### Starting master-bin.000008 flush logs; + delimiter //; create procedure p1() begin @@ -178,7 +203,10 @@ select 1; end; // delimiter ;// + +### Starting master-bin.000009 flush logs; + call p1(); drop procedure p1; --error ER_SP_DOES_NOT_EXIST @@ -202,7 +230,9 @@ drop procedure p1; # (LOAD DATA INFILE need it) # +### Starting master-bin.000010 flush logs; + create table t1 (a varchar(64) character set utf8); load data infile '../../std_data/loaddata6.dat' into table t1; set character_set_database=koi8r; @@ -217,7 +247,10 @@ load data infile '../../std_data/loaddat load data infile '../../std_data/loaddata6.dat' into table t1 character set koi8r; select hex(a) from t1; drop table t1; + +### Starting master-bin.000011 flush logs; + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ --exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000010 @@ -229,9 +262,14 @@ flush logs; CREATE TABLE t1 (c1 CHAR(10)); # we need this for getting fixed timestamps inside of this test +### Starting master-bin.000012 FLUSH LOGS; + INSERT INTO t1 VALUES ('0123456789'); + +### Starting master-bin.000013 FLUSH LOGS; + DROP TABLE t1; # We create a table, patch, and load the output into it @@ -257,11 +295,16 @@ DROP TABLE patch; # # Bug#29928 incorrect connection_id() restoring from mysqlbinlog out # +### Starting master-bin.000014 FLUSH LOGS; + CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(connection_id()); let $a= `SELECT a FROM t1`; + +### Starting master-bin.000015 FLUSH LOGS; + let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql; --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile DROP TABLE t1; @@ -281,11 +324,12 @@ error 1; exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTEST_VARDIR/tmp/bug31793.sql; --remove_file $MYSQLTEST_VARDIR/tmp/bug31793.sql - # # Test --disable-force-if-open and --force-if-open # +### Starting master-bin.000016 FLUSH LOGS; + --error 1 --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null --exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null @@ -300,9 +344,15 @@ GRANT SELECT ON mysqltest1.* TO untruste SHOW GRANTS FOR untrusted@localhost; USE mysqltest1; CREATE TABLE t1 (a INT, b CHAR(64)); + +### Starting master-bin.000017 flush logs; + INSERT INTO t1 VALUES (1,USER()); + +### Starting master-bin.000018 flush logs; + echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql; exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; connect (unsecure,localhost,untrusted,,mysqltest1); @@ -326,14 +376,20 @@ DROP USER untrusted@localhost; connection default; USE test; SET BINLOG_FORMAT = STATEMENT; + +### Starting master-bin.000019 FLUSH LOGS; + CREATE TABLE t1 (a_real FLOAT, an_int INT, a_decimal DECIMAL(5,2), a_string CHAR(32)); SET @a_real = rand(20) * 1000; SET @an_int = 1000; SET @a_decimal = CAST(rand(19) * 999 AS DECIMAL(5,2)); SET @a_string = 'Just a test'; INSERT INTO t1 VALUES (@a_real, @an_int, @a_decimal, @a_string); + +### Starting master-bin.000020 FLUSH LOGS; + query_vertical SELECT * FROM t1; DROP TABLE t1; @@ -357,6 +413,7 @@ eval SET @@global.server_id= $s_id_max; RESET MASTER; FLUSH LOGS; + --exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 > $binlog_file --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval SELECT === modified file 'mysql-test/t/mysqlbinlog2.test' --- a/mysql-test/t/mysqlbinlog2.test 2008-03-25 17:40:49 +0000 +++ b/mysql-test/t/mysqlbinlog2.test 2010-05-23 08:40:25 +0000 @@ -3,7 +3,7 @@ # TODO: Need to look at making row based version once new binlog client is complete. -- source include/have_binlog_format_mixed_or_statement.inc - +-- source include/binlog_start_pos.inc --disable_warnings drop table if exists t1; @@ -50,15 +50,19 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 +let $start_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=608 $MYSQLD_DATADIR/master-bin.000001 +let $stop_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLD_DATADIR/master-bin.000001 +let $start_pos= `select @binlog_start_pos + 502`; +let $stop_pos= `select @binlog_start_pos + 619`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -84,11 +88,13 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +let $start_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=134 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +let $stop_pos= `select @binlog_start_pos + 28`; +--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -111,15 +117,19 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +let $start_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +let $stop_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +let $start_pos= `select @binlog_start_pos + 502`; +let $stop_pos= `select @binlog_start_pos + 619`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -142,11 +152,13 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +let $start_pos= `select @binlog_start_pos + 502`; +--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=134 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +let $stop_pos= `select @binlog_start_pos + 28`; +--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log === modified file 'mysql-test/t/sp_trans_log.test' --- a/mysql-test/t/sp_trans_log.test 2009-04-28 18:42:17 +0000 +++ b/mysql-test/t/sp_trans_log.test 2010-05-23 08:40:25 +0000 @@ -4,6 +4,7 @@ # part of sp_trans test that appeared to be sensitive to binlog format --source include/have_innodb.inc --source include/have_binlog_format_mixed_or_row.inc +--source include/binlog_start_pos.inc delimiter |; @@ -35,7 +36,8 @@ reset master| --error ER_DUP_ENTRY insert into t2 values (bug23333(),1)| --replace_column 2 # 5 # 6 # -show binlog events from 106 /* with fixes for #23333 will show there is the query */| +--replace_result $binlog_start_pos <start_pos> +eval show binlog events from $binlog_start_pos; /* with fixes for #23333 will show there is the query */| select count(*),@a from t1 /* must be 1,1 */| delimiter ;|