diff options
author | Mats Kindahl <mats@sun.com> | 2009-02-09 23:51:59 +0100 |
---|---|---|
committer | Mats Kindahl <mats@sun.com> | 2009-02-09 23:51:59 +0100 |
commit | cb731001051bd1ab424711740196695a5d369240 (patch) | |
tree | 82b5d2468e08a43e31587af5f72ab6d52e5aff5c /mysql-test/suite/binlog | |
parent | e3708c231ecbd0790ccce2a24319ae86c37a4f52 (diff) | |
parent | a8c57f9a03ecf4dbdf408c7229f80f1b1a9afc50 (diff) | |
download | mariadb-git-cb731001051bd1ab424711740196695a5d369240.tar.gz |
Merging with 5.1-bugteam.
Diffstat (limited to 'mysql-test/suite/binlog')
24 files changed, 341 insertions, 78 deletions
diff --git a/mysql-test/suite/binlog/combinations b/mysql-test/suite/binlog/combinations index ea25611a5d4..07042c2cbec 100644 --- a/mysql-test/suite/binlog/combinations +++ b/mysql-test/suite/binlog/combinations @@ -1,8 +1,8 @@ [row] ---binlog-format=row +binlog-format=row [stmt] ---binlog-format=statement +binlog-format=statement [mix] ---binlog-format=mixed +binlog-format=mixed diff --git a/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result b/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result index 68f1f0b2566..8df0568a755 100644 --- a/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result +++ b/mysql-test/suite/binlog/r/binlog_auto_increment_bug33029.result @@ -1,3 +1,4 @@ +SET @old_relay_log_purge= @@global.relay_log_purge; change master to MASTER_HOST='dummy.localdomain', RELAY_LOG_FILE='slave-relay-bin.000001', @@ -37,3 +38,4 @@ DROP PROCEDURE IF EXISTS p2; DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS tr1; stop slave sql_thread; +SET @@global.relay_log_purge= @old_relay_log_purge; diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result index fbc2b8344ee..58c444c9571 100644 --- a/mysql-test/suite/binlog/r/binlog_base64_flag.result +++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result @@ -37,7 +37,7 @@ DELIMITER /*!*/; # at 102 <#>use test/*!*/; SET TIMESTAMP=1196959712/*!*/; -<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 39b889d8d0a..8dbe0f21852 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -114,5 +114,6 @@ FLUSH STATUS; show databases; Database information_schema +mtr mysql test diff --git a/mysql-test/suite/binlog/r/binlog_index.result b/mysql-test/suite/binlog/r/binlog_index.result new file mode 100644 index 00000000000..d49ceb00501 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_index.result @@ -0,0 +1,40 @@ +flush logs; +flush logs; +flush logs; +show binary logs; +Log_name File_size +master-bin.000001 # +master-bin.000002 # +master-bin.000003 # +master-bin.000004 # +purge binary logs TO 'master-bin.000004'; +Warnings: +Warning 1612 Being purged log master-bin.000001 was not found +*** must show a list starting from the 'TO' argument of PURGE *** +show binary logs; +Log_name File_size +master-bin.000004 # +reset master; +flush logs; +flush logs; +flush logs; +*** must be a warning master-bin.000001 was not found *** +Warnings: +Warning 1612 Being purged log master-bin.000001 was not found +Warning 1612 Being purged log master-bin.000001 was not found +*** must show one record, of the active binlog, left in the index file after PURGE *** +show binary logs; +Log_name File_size +master-bin.000004 # +reset master; +flush logs; +flush logs; +flush logs; +purge binary logs TO 'master-bin.000002'; +ERROR HY000: Fatal error during log purge +show warnings; +Level Code Message +Error 1377 a problem with deleting master-bin.000001; consider examining correspondence of your binlog index file to the actual binlog files +Error 1377 Fatal error during log purge +reset master; +End of tests diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result index 66d3a86cd5a..634d3f62814 100644 --- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result +++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result @@ -14,12 +14,12 @@ select 1 /* must return 1 as query completed before got killed*/; 1 create table t2 (a int, b int) ENGINE=MyISAM; reset master; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; +load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; ERROR 70100: Query execution was interrupted show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# -master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) is not null; diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index a295657b8f8..caae5f55d13 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -17,24 +17,24 @@ TRUNCATE t1b; TRUNCATE t1n; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f -master-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1n) -master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; TRUNCATE t1m -master-bin.000001 # Query # # use `test`; TRUNCATE t1b -master-bin.000001 # Query # # use `test`; TRUNCATE t1n +mysqld-bin.000001 # Query # # use `test`; BEGIN +mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # use `test`; COMMIT +mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # use `test`; BEGIN +mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f +mysqld-bin.000001 # Query # # use `test`; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c +mysqld-bin.000001 # Query # # use `test`; COMMIT +mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Table_map # # table_id: # (test.t1n) +mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n RESET MASTER; SET SESSION BINLOG_FORMAT=MIXED; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); @@ -48,20 +48,20 @@ TRUNCATE t1b; TRUNCATE t1n; show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1n) -master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c -master-bin.000001 # Query # # use `test`; TRUNCATE t1m -master-bin.000001 # Query # # use `test`; TRUNCATE t1b -master-bin.000001 # Query # # use `test`; TRUNCATE t1n +mysqld-bin.000001 # Query # # use `test`; BEGIN +mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # use `test`; COMMIT +mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Table_map # # table_id: # (test.t1n) +mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +mysqld-bin.000001 # Write_rows # # table_id: # +mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b +mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n RESET MASTER; SET SESSION BINLOG_FORMAT=ROW; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); @@ -73,19 +73,19 @@ UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging show binlog events from <binlog_start>; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1m) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # use `test`; BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1b) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1n) -master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # use `test`; BEGIN +mysqld-bin.000001 # Table_map # # table_id: # (test.t1m) +mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Query # # use `test`; COMMIT +mysqld-bin.000001 # Query # # use `test`; BEGIN +mysqld-bin.000001 # Table_map # # table_id: # (test.t1b) +mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Query # # use `test`; COMMIT +mysqld-bin.000001 # Query # # BEGIN +mysqld-bin.000001 # Table_map # # table_id: # (test.t1n) +mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +mysqld-bin.000001 # Write_rows # # table_id: # +mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +mysqld-bin.000001 # Query # # COMMIT RESET MASTER; DROP TABLE t1m, t1b, t1n; diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result index a066928fc13..49aa64adfb5 100644 --- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result @@ -17,7 +17,7 @@ ROLLBACK/*!*/; use test/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index dcad7e022b7..0606c223126 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -673,7 +673,7 @@ delete from t1; create table t4 (a int default 0, b int primary key) engine=innodb; insert into t4 values (0, 17); reset master; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); ERROR 23000: Duplicate entry '17' for key 'PRIMARY' select * from t4; a b @@ -901,7 +901,7 @@ delete from t1; create table t4 (a int default 0, b int primary key) engine=innodb; insert into t4 values (0, 17); reset master; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); ERROR 23000: Duplicate entry '17' for key 'PRIMARY' select * from t4; a b @@ -917,7 +917,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_ln/rpl_loaddata.dat' into table t4 (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 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # use `test`; ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/binlog/r/binlog_start_comment.result b/mysql-test/suite/binlog/r/binlog_start_comment.result index 162968195f2..c5c906dfc4e 100644 --- a/mysql-test/suite/binlog/r/binlog_start_comment.result +++ b/mysql-test/suite/binlog/r/binlog_start_comment.result @@ -2,7 +2,7 @@ reset master; drop table if exists t1,t2; create table t1 (word varchar(20)) -- create table t1; create table t2 (word varchar(20)) -- create table t2; -load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1; +load data infile '../../std_data/words.dat' into table t1 -- load data to t1; insert into t2 values ("Ada"); flush logs; select * from t2; diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result index 30f298488fc..1cd77cfbed4 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result +++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result @@ -92,7 +92,7 @@ insert into t1 values(1); insert ignore into t1 values(1); replace into t1 values(100); create table t2 (a varchar(200)) engine=blackhole; -load data infile '../std_data_ln/words.dat' into table t2; +load data infile '../../std_data/words.dat' into table t2; alter table t1 add b int; alter table t1 drop b; create table t3 like t1; @@ -127,7 +127,7 @@ master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; create table t2 (a varchar(200)) engine=blackhole master-bin.000001 # Query # # use `test`; BEGIN master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=581 -master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=# +master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t2 ;file_id=# master-bin.000001 # Query # # use `test`; COMMIT master-bin.000001 # Query # # use `test`; alter table t1 add b int master-bin.000001 # Query # # use `test`; alter table t1 drop b 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 1b14686a97d..b7edf7fedb8 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -16,7 +16,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; use test/*!*/; SET TIMESTAMP=10000/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; 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 3d71f333852..6d943ed9da1 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 @@ -611,7 +611,7 @@ delete from t1; create table t4 (a int default 0, b int primary key) engine=innodb; insert into t4 values (0, 17); reset master; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); ERROR 23000: Duplicate entry '17' for key 'PRIMARY' select * from t4; a b @@ -625,7 +625,7 @@ master-bin.000001 # Query # # use `test`; 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_ln/rpl_loaddata.dat' into table t4 (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 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # use `test`; ROLLBACK /* the output must denote there is the query */; drop trigger trg_del_t2; @@ -845,7 +845,7 @@ delete from t1; create table t4 (a int default 0, b int primary key) engine=innodb; insert into t4 values (0, 17); reset master; -load data infile '../std_data_ln/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); +load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2); ERROR 23000: Duplicate entry '17' for key 'PRIMARY' select * from t4; a b @@ -861,7 +861,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_ln/rpl_loaddata.dat' into table t4 (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 (a, @b) set b= @b + bug27417(2) ;file_id=# master-bin.000001 # Query # # use `test`; ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result index 97ec38cfb3e..d1cc55f03b3 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_row.result +++ b/mysql-test/suite/binlog/r/binlog_stm_row.result @@ -1,5 +1,7 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; +set @saved_global_binlog_format = @@global.binlog_format; +set @saved_local_binlog_format = @@session.binlog_format; SET GLOBAL BINLOG_FORMAT = STATEMENT; SET SESSION BINLOG_FORMAT = STATEMENT; CREATE TABLE t1 (a INT); @@ -69,3 +71,5 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; COMMIT DROP TABLE t1; DROP TABLE t2; +SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format; +SET SESSION BINLOG_FORMAT = @saved_local_binlog_format; diff --git a/mysql-test/suite/binlog/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_tmp_table.result new file mode 100644 index 00000000000..e4928432324 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_tmp_table.result @@ -0,0 +1,30 @@ +create table foo (a int); +flush logs; +create temporary table tmp1_foo like foo; +create temporary table tmp2_foo (a int); +insert into tmp1_foo values (1), (2), (3), (4); +replace into tmp2_foo values (1), (2), (3), (4); +update tmp1_foo set a=2*a-1; +update tmp2_foo set a=2*a; +delete from tmp1_foo where a < 5; +delete from tmp2_foo where a < 5; +insert into foo select * from tmp1_foo; +insert into foo select * from tmp2_foo; +truncate table tmp1_foo; +truncate table tmp2_foo; +flush logs; +select * from foo; +a +5 +7 +6 +8 +drop table foo; +create table foo (a int); +select * from foo; +a +5 +7 +6 +8 +drop table foo; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 1f7b217dc31..7c0980ba77c 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -220,3 +220,10 @@ Warning 1592 Statement is not safe to log in statement format. Warning 1592 Statement is not safe to log in statement format. DROP PROCEDURE p1; DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); +INSERT INTO t1 VALUES ('a','b'); +UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; +Warnings: +Warning 1592 Statement is not safe to log in statement format. +DROP TABLE t1; diff --git a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test index e77c9398c59..f20cc33f820 100644 --- a/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test +++ b/mysql-test/suite/binlog/t/binlog_auto_increment_bug33029.test @@ -17,9 +17,15 @@ source include/have_log_bin.inc; -copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLTEST_VARDIR/master-data/slave-relay-bin.000001; +# Need to restore this at the end; CHANGE MASTER modifies it (see the +# manual for CHANGE MASTER). +SET @old_relay_log_purge= @@global.relay_log_purge; -write_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.index; +let $MYSQLD_DATADIR= `select @@datadir`; + +copy_file $MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001 $MYSQLD_DATADIR/slave-relay-bin.000001; + +write_file $MYSQLD_DATADIR/slave-relay-bin.index; slave-relay-bin.000001 EOF @@ -46,9 +52,9 @@ DROP FUNCTION IF EXISTS f1; DROP TRIGGER IF EXISTS tr1; enable_warnings; -remove_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.000001; -remove_file $MYSQLTEST_VARDIR/master-data/slave-relay-bin.index; +remove_file $MYSQLD_DATADIR/slave-relay-bin.000001; +remove_file $MYSQLD_DATADIR/slave-relay-bin.index; stop slave sql_thread; -let $keep_connection=1; source include/wait_for_slave_sql_to_stop.inc; +SET @@global.relay_log_purge= @old_relay_log_purge; diff --git a/mysql-test/suite/binlog/t/binlog_index.test b/mysql-test/suite/binlog/t/binlog_index.test new file mode 100644 index 00000000000..13287465b88 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_index.test @@ -0,0 +1,69 @@ +# +# testing of purging of binary log files bug#18199/Bug#18453 +# +source include/have_log_bin.inc; +source include/not_embedded.inc; + +# +# testing purge binary logs TO +# + +flush logs; +flush logs; +flush logs; + +source include/show_binary_logs.inc; +let $MYSQLD_DATADIR= `select @@datadir`; +remove_file $MYSQLD_DATADIR/master-bin.000001; + +# there must be a warning with file names +replace_regex /\.[\\\/]master/master/; +purge binary logs TO 'master-bin.000004'; + +--echo *** must show a list starting from the 'TO' argument of PURGE *** +source include/show_binary_logs.inc; + +# +# testing purge binary logs BEFORE +# + +reset master; + +flush logs; +flush logs; +flush logs; +remove_file $MYSQLD_DATADIR/master-bin.000001; + +--echo *** must be a warning master-bin.000001 was not found *** +let $date=`select NOW() + INTERVAL 1 MINUTE`; +--disable_query_log +replace_regex /\.[\\\/]master/master/; +eval purge binary logs BEFORE '$date'; +--enable_query_log + +--echo *** must show one record, of the active binlog, left in the index file after PURGE *** +source include/show_binary_logs.inc; + +# +# testing a fatal error +# Turning a binlog file into a directory must be a portable setup +# + +reset master; + +flush logs; +flush logs; +flush logs; + +remove_file $MYSQLD_DATADIR/master-bin.000001; +mkdir $MYSQLD_DATADIR/master-bin.000001; + +--error ER_BINLOG_PURGE_FATAL_ERR +purge binary logs TO 'master-bin.000002'; +replace_regex /\.[\\\/]master/master/; +show warnings; +rmdir $MYSQLD_DATADIR/master-bin.000001; +--disable_warnings +reset master; +--enable_warnings +--echo End of tests diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index e63186b64c8..9b30ec4a0db 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -50,7 +50,8 @@ connection con2; reap; let $rows= `select count(*) from t2 /* must be 2 or 0 */`; ---exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYSQL_BINLOG --force-if-open --start-position=134 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog")) @@ -261,7 +262,7 @@ source include/show_binlog_events.inc; # a proof the query is binlogged with an error ---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -307,7 +308,7 @@ source include/show_binlog_events.inc; # a proof the query is binlogged with an error ---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index 8af51fc5fe5..ec61271ae88 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -23,7 +23,8 @@ update t1 set a=2 /* will be "killed" after work has been done */; #todo: introduce a suite private macro that provides numeric values # for some constants like the offset of the first real event # that is different between severs versions. ---exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYSQL_BINLOG --force-if-open --start-position=106 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) @@ -44,14 +45,14 @@ remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog; create table t2 (a int, b int) ENGINE=MyISAM; reset master; --error ER_QUERY_INTERRUPTED -load data infile '../std_data_ln/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; +load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */; # a proof the query is binlogged with an error source include/show_binlog_events.inc; ---exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=98 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) diff --git a/mysql-test/suite/binlog/t/binlog_start_comment.test b/mysql-test/suite/binlog/t/binlog_start_comment.test index 6f8540efd07..98f2ca05505 100644 --- a/mysql-test/suite/binlog/t/binlog_start_comment.test +++ b/mysql-test/suite/binlog/t/binlog_start_comment.test @@ -10,15 +10,16 @@ drop table if exists t1,t2; --enable_warnings create table t1 (word varchar(20)) -- create table t1; create table t2 (word varchar(20)) -- create table t2; -load data infile '../std_data_ln/words.dat' into table t1 -- load data to t1; +load data infile '../../std_data/words.dat' into table t1 -- load data to t1; insert into t2 values ("Ada"); flush logs; select * from t2; ---exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog +let $MYSQLD_DATADIR= `select @@datadir`; +--exec $MYSQL_BINLOG --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog --exec $MYSQL --local-infile=1 < $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog flush logs; select * from t2; # clean up drop table t1,t2; -#--remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog +remove_file $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog; diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test index 4944e65c9f3..e923faae940 100644 --- a/mysql-test/suite/binlog/t/binlog_stm_row.test +++ b/mysql-test/suite/binlog/t/binlog_stm_row.test @@ -19,6 +19,8 @@ DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; --enable_warnings +set @saved_global_binlog_format = @@global.binlog_format; +set @saved_local_binlog_format = @@session.binlog_format; SET GLOBAL BINLOG_FORMAT = STATEMENT; SET SESSION BINLOG_FORMAT = STATEMENT; @@ -105,3 +107,5 @@ source include/show_binlog_events.inc; DROP TABLE t1; DROP TABLE t2; +SET GLOBAL BINLOG_FORMAT = @saved_global_binlog_format; +SET SESSION BINLOG_FORMAT = @saved_local_binlog_format; diff --git a/mysql-test/suite/binlog/t/binlog_tmp_table.test b/mysql-test/suite/binlog/t/binlog_tmp_table.test new file mode 100644 index 00000000000..6947959a5e0 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_tmp_table.test @@ -0,0 +1,83 @@ +# ==== Purpose ==== +# +# Test if statements used temporary tables are binlogged correctly +# +# ==== Method ==== +# +# Use two connections, use temporary tables on both of them, and by +# switching connections between statements, the test can check if the +# statements are logged with the correct thread id. +# +# The statements current tested include: +# CREATE TEMPORARY TABLE +# CREATE TEMPORARY TABLE LIKE +# INSERT +# REPLACE +# UPDATE +# INSERT SELECT +# TRUNCATE +# +# Note: When adding new query statements, please add them between the +# two 'flush logs'. And aslo please make sure the connection is +# switched between each statement. +# +# ==== Related bugs ==== +# +# BUG#35583 mysqlbinlog replay fails with ERROR 1146 when temp tables are used +# +source include/have_log_bin.inc; +source include/have_binlog_format_mixed_or_statement.inc; + +connect (master,127.0.0.1,root,,test,$MASTER_MYPORT,); +connect (master1,127.0.0.1,root,,test,$MASTER_MYPORT,); + +create table foo (a int); + +flush logs; + +connection master; +create temporary table tmp1_foo like foo; +connection master1; +create temporary table tmp2_foo (a int); + +connection master; +insert into tmp1_foo values (1), (2), (3), (4); +connection master1; +replace into tmp2_foo values (1), (2), (3), (4); + +connection master; +update tmp1_foo set a=2*a-1; +connection master1; +update tmp2_foo set a=2*a; + +connection master; +delete from tmp1_foo where a < 5; +connection master1; +delete from tmp2_foo where a < 5; + +connection master; +insert into foo select * from tmp1_foo; +connection master1; +insert into foo select * from tmp2_foo; + +connection master; +truncate table tmp1_foo; +connection master1; +truncate table tmp2_foo; + +flush logs; + +connection default; +select * from foo; + +# prepare for the replay +drop table foo; +create table foo (a int); + +# replay from binary log +let $MYSQLD_DATADIR= `select @@datadir`; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000002 | $MYSQL; +select * from foo; + +# clean up +drop table foo; diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index 0d7059bc31f..f58233d4fef 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -257,3 +257,17 @@ delimiter ;| CALL p1(); DROP PROCEDURE p1; DROP TABLE t1; + +# +# Bug#42634: % character in query can cause mysqld signal 11 segfault +# + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); +INSERT INTO t1 VALUES ('a','b'); +UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; +DROP TABLE t1; + |