mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge mysql-test/include/have_multi_ndb.inc: Auto merged mysql-test/lib/mtr_cases.pl: Auto merged mysql-test/lib/mtr_report.pl: Auto merged mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Auto merged mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result: Auto merged mysql-test/suite/rpl_ndb/t/disabled.def: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/log.cc: Auto merged sql/log_event_old.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/rpl_rli.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/sql_binlog.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_string.cc: Auto merged mysql-test/Makefile.am: SCCS merged mysql-test/mysql-test-run.pl: Manual merge. mysql-test/suite/binlog/t/disabled.def: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result: Manual merge. mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result: Manual merge. sql/log_event.cc: Manual merge. ,
This commit is contained in:
60
mysql-test/suite/binlog/r/binlog_base64_flag.result
Normal file
60
mysql-test/suite/binlog/r/binlog_base64_flag.result
Normal file
@@ -0,0 +1,60 @@
|
||||
==== Test BUG#32407 ====
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
==== Test BINLOG statement w/o FD event ====
|
||||
BINLOG '
|
||||
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
ERROR HY000: The BINLOG statement of type `Table_map` was not preceded by a format description BINLOG statement.
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
==== Test BINLOG statement with FD event ====
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
BINLOG '
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
3
|
||||
==== Test --base64-output=never on a binlog with row events ====
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
# at 4
|
||||
#ROLLBACK/*!*/;
|
||||
# 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.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
create table t1 (a int) engine= myisam/*!*/;
|
||||
# at 203
|
||||
==== Test non-matching FD event and Row event ====
|
||||
BINLOG '
|
||||
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
|
||||
';
|
||||
BINLOG '
|
||||
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
|
||||
';
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
|
||||
select * from t1;
|
||||
a
|
||||
1
|
||||
1
|
||||
3
|
||||
drop table t1;
|
@@ -66,6 +66,7 @@ COMMIT;
|
||||
show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
|
@@ -18,8 +18,12 @@ 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`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
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`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
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
|
||||
@@ -49,8 +53,12 @@ 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`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2)
|
||||
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`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE t1m
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE t1b
|
||||
master-bin.000001 # Query # # BEGIN
|
||||
|
15
mysql-test/suite/binlog/r/binlog_start_comment.result
Normal file
15
mysql-test/suite/binlog/r/binlog_start_comment.result
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
||||
insert into t2 values ("Ada");
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
||||
flush logs;
|
||||
select * from t2;
|
||||
word
|
||||
Ada
|
||||
drop table t1,t2;
|
@@ -108,19 +108,35 @@ show binlog events from <binlog_start>;
|
||||
Log_name Pos Event_type Server_id End_log_pos Info
|
||||
master-bin.000001 # Query # # use `test`; drop table t1,t2
|
||||
master-bin.000001 # Query # # use `test`; create table t1 (a int) engine=blackhole
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t1 where a=10
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; update t1 set a=11 where a=15
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(1)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert ignore into t1 values(1)
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; replace into t1 values(100)
|
||||
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=1;block_len=581
|
||||
master-bin.000001 # Execute_load_query # # use `test`; load data infile '../std_data_ln/words.dat' into table t2 ;file_id=1
|
||||
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
|
||||
master-bin.000001 # Query # # use `test`; create table t3 like t1
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 select * from t3
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; replace into t1 select * from t3
|
||||
master-bin.000001 # Query # # use `test`; COMMIT
|
||||
drop table t1,t2,t3;
|
||||
CREATE TABLE t1(a INT) ENGINE=BLACKHOLE;
|
||||
INSERT DELAYED INTO t1 VALUES(1);
|
||||
|
@@ -19,7 +19,8 @@ SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.uniq
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
insert into t2 values (@v)/*!*/;
|
||||
insert into t2 values (@v)
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
|
@@ -100,6 +100,7 @@ insert into t1 values(9);
|
||||
insert into t2 select * from t1;
|
||||
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 t1 values(9)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
@@ -111,6 +112,7 @@ begin;
|
||||
insert into t2 select * from t1;
|
||||
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 t1 values(10)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
@@ -118,6 +120,7 @@ insert into t1 values(11);
|
||||
commit;
|
||||
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 t1 values(10)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select * from t1
|
||||
@@ -233,16 +236,20 @@ master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(16)
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values(18)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t1
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; delete from t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into t1 values (1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 values (20)
|
||||
master-bin.000001 # Query # # use `test`; drop table t1,t2
|
||||
master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; insert into ti values(1)
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam
|
||||
@@ -339,6 +346,7 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3)
|
||||
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
|
||||
master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5)
|
||||
@@ -348,6 +356,7 @@ master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b in
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8)
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9)
|
||||
master-bin.000001 # Query # # use `test`; BEGIN
|
||||
master-bin.000001 # Query # # use `test`; TRUNCATE table t2
|
||||
master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10)
|
||||
@@ -375,9 +384,9 @@ is not null;
|
||||
is not null
|
||||
1
|
||||
select
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a not like "%#%error_code=%error_code=%";
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
||||
@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%"
|
||||
1 1
|
||||
drop table t1, t2;
|
||||
set @@session.binlog_format=statement;
|
||||
@@ -503,6 +512,7 @@ insert into t2 values (bug27417(1));
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
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 # Intvar # # INSERT_ID=1
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1))
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
@@ -517,6 +527,7 @@ insert into t2 select bug27417(1) union select bug27417(2);
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
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 # Intvar # # INSERT_ID=2
|
||||
master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2)
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
@@ -544,6 +555,7 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */;
|
||||
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
|
||||
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 # Intvar # # INSERT_ID=6
|
||||
master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
@@ -574,6 +586,7 @@ delete from t2;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
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 # Intvar # # INSERT_ID=9
|
||||
master-bin.000001 # Query # # use `test`; delete from t2
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
@@ -593,6 +606,7 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1;
|
||||
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
|
||||
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`; delete t2.* from t2,t5 where t2.a=t5.a + 1
|
||||
master-bin.000001 # Query # # use `test`; ROLLBACK
|
||||
select count(*) from t1 /* must be 1 */;
|
||||
@@ -612,6 +626,7 @@ count(*)
|
||||
2
|
||||
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 # Intvar # # INSERT_ID=10
|
||||
master-bin.000001 # Begin_load_query # # ;file_id=1;block_len=12
|
||||
master-bin.000001 # Intvar # # INSERT_ID=10
|
||||
|
BIN
mysql-test/suite/binlog/std_data/binlog-bug32407.000001
Normal file
BIN
mysql-test/suite/binlog/std_data/binlog-bug32407.000001
Normal file
Binary file not shown.
102
mysql-test/suite/binlog/t/binlog_base64_flag.test
Normal file
102
mysql-test/suite/binlog/t/binlog_base64_flag.test
Normal file
@@ -0,0 +1,102 @@
|
||||
# This test case verifies that the mysqlbinlog --base64-output=X flags
|
||||
# work as expected, and that BINLOG statements with row events fail if
|
||||
# they are not preceded by BINLOG statements with Format description
|
||||
# events.
|
||||
#
|
||||
# See also BUG#32407.
|
||||
|
||||
|
||||
# Test to show BUG#32407. This reads a binlog created with the
|
||||
# mysql-5.1-telco-6.1 tree, specifically at the tag
|
||||
# mysql-5.1.15-ndb-6.1.23, and applies it to the database. The test
|
||||
# should fail before BUG#32407 was fixed and succeed afterwards.
|
||||
--echo ==== Test BUG#32407 ====
|
||||
|
||||
# The binlog contains row events equivalent to:
|
||||
# CREATE TABLE t1 (a int) engine = myisam
|
||||
# INSERT INTO t1 VALUES (1), (1)
|
||||
exec $MYSQL_BINLOG suite/binlog/std_data/binlog-bug32407.000001 | $MYSQL;
|
||||
# The above line should succeed and t1 should contain two ones
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that a BINLOG statement encoding a row event fails unless a
|
||||
# Format_description_event as been supplied with an earlier BINLOG
|
||||
# statement.
|
||||
--echo ==== Test BINLOG statement w/o FD event ====
|
||||
|
||||
# This is a binlog statement consisting of one Table_map_log_event and
|
||||
# one Write_rows_log_event. Together, they correspond to the
|
||||
# following query:
|
||||
# INSERT INTO TABLE test.t1 VALUES (2)
|
||||
|
||||
error ER_NO_FORMAT_DESCRIPTION_EVENT_BEFORE_BINLOG_STATEMENT;
|
||||
BINLOG '
|
||||
SVtYRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
SVtYRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+AgAAAA==
|
||||
';
|
||||
# The above line should fail and 2 should not be in the table
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that it works to read a Format_description_log_event with a
|
||||
# BINLOG statement, followed by a row-event in base64 from the same
|
||||
# version.
|
||||
--echo ==== Test BINLOG statement with FD event ====
|
||||
|
||||
# This is a binlog statement containing a Format_description_log_event
|
||||
# from the same version as the Table_map and Write_rows_log_event.
|
||||
BINLOG '
|
||||
ODdYRw8BAAAAZgAAAGoAAAABAAQANS4xLjIzLXJjLWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAA4N1hHEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC
|
||||
';
|
||||
|
||||
# This is a Table_map_log_event+Write_rows_log_event corresponding to:
|
||||
# INSERT INTO TABLE test.t1 VALUES (3)
|
||||
BINLOG '
|
||||
TFtYRxMBAAAAKQAAAH8BAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
|
||||
';
|
||||
# The above line should succeed and 3 should be in the table
|
||||
select * from t1;
|
||||
|
||||
|
||||
# Test that mysqlbinlog stops with an error message when the
|
||||
# --base64-output=never flag is used on a binlog with base64 events.
|
||||
--echo ==== Test --base64-output=never on a binlog with row events ====
|
||||
|
||||
# mysqlbinlog should fail
|
||||
--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/#/
|
||||
error 1;
|
||||
exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/binlog-bug32407.000001;
|
||||
# the above line should output the query log event and then stop
|
||||
|
||||
|
||||
# Test that the following fails cleanly: "First, read a
|
||||
# Format_description event which has N event types. Then, read an
|
||||
# event of type M>N"
|
||||
--echo ==== Test non-matching FD event and Row event ====
|
||||
|
||||
# This is the Format_description_log_event from
|
||||
# binlog-bug32407.000001, encoded in base64. It contains only the old
|
||||
# row events (number of event types is 22)
|
||||
BINLOG '
|
||||
4CdYRw8BAAAAYgAAAGYAAAAAAAQANS4xLjE1LW5kYi02LjEuMjQtZGVidWctbG9nAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAADgJ1hHEzgNAAgAEgAEBAQEEgAATwAEGggICAg=
|
||||
';
|
||||
|
||||
# The following is a Write_rows_log_event with event type 23, i.e.,
|
||||
# not supported by the Format_description_log_event above. It
|
||||
# corresponds to the following query:
|
||||
# INSERT INTO t1 VALUES (5)
|
||||
error 1149;
|
||||
BINLOG '
|
||||
Dl1YRxMBAAAAKQAAADQBAAAAABAAAAAAAAAABHRlc3QAAnQxAAEDAAE=
|
||||
Dl1YRxcBAAAAIgAAAFYBAAAQABAAAAAAAAEAAf/+BQAAAA==
|
||||
';
|
||||
# the above line should fail and 5 should not be in the binlog.
|
||||
select * from t1;
|
||||
|
||||
|
||||
# clean up
|
||||
drop table t1;
|
22
mysql-test/suite/binlog/t/binlog_start_comment.test
Normal file
22
mysql-test/suite/binlog/t/binlog_start_comment.test
Normal file
@@ -0,0 +1,22 @@
|
||||
# Test case for bug#32205 Replaying statements from mysqlbinlog fails
|
||||
# with a syntax error, replicates fine
|
||||
|
||||
-- source include/have_log_bin.inc
|
||||
reset master;
|
||||
--disable_warnings
|
||||
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;
|
||||
insert into t2 values ("Ada");
|
||||
flush logs;
|
||||
select * from t2;
|
||||
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
||||
flush logs;
|
||||
select * from t2;
|
||||
|
||||
# clean up
|
||||
drop table t1,t2;
|
||||
--system rm $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
|
@@ -19,7 +19,7 @@ eval select
|
||||
is not null;
|
||||
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
||||
eval select
|
||||
@a like "%#%error_code=0%ROLLBACK/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%",
|
||||
@a not like "%#%error_code=%error_code=%";
|
||||
|
||||
drop table t1, t2;
|
||||
|
@@ -10,3 +10,4 @@
|
||||
#
|
||||
##############################################################################
|
||||
binlog_multi_engine : Bug#32663 binlog_multi_engine.test fails randomly
|
||||
binlog_base64_flag : BUG#33247 2007-12-14 Sven: mysqlbinlog does not clean up after itself on termination. When compiled in debug mode, this test generates lots of warnings for memory leaks.
|
||||
|
Reference in New Issue
Block a user