Commit 0ffd1be8 authored by mats@mysql.com's avatar mats@mysql.com

WL#3023 (RBR: Use locks in a statement-like manner):

  More adaptions to make it work with existing code base.
parent 1e66bc0d
...@@ -114,6 +114,7 @@ connection master; ...@@ -114,6 +114,7 @@ connection master;
drop database mysqltest2; drop database mysqltest2;
drop database mysqltest3; drop database mysqltest3;
--replace_column 2 # 5 # --replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/
show binlog events from 102; show binlog events from 102;
sync_slave_with_master; sync_slave_with_master;
......
...@@ -86,41 +86,43 @@ a int not null primary key, ...@@ -86,41 +86,43 @@ a int not null primary key,
b text not null b text not null
) engine=ndb ) engine=ndb
master-bin.000001 239 Query 1 303 BEGIN master-bin.000001 239 Query 1 303 BEGIN
master-bin.000001 303 Table_map 1 65 cluster_replication.apply_status master-bin.000001 303 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 368 Write_rows 1 107 master-bin.000001 343 Table_map 1 105 table_id: # (cluster_replication.apply_status)
master-bin.000001 410 Table_map 1 147 test.t1 master-bin.000001 408 Write_rows 1 147 table_id: #
master-bin.000001 450 Write_rows 1 818 master-bin.000001 450 Write_rows 1 818 table_id: #
master-bin.000001 1121 Write_rows 1 9853 master-bin.000001 1121 Write_rows 1 9853 table_id: # flags: STMT_END_F
master-bin.000001 10156 Query 1 10221 COMMIT master-bin.000001 10156 Query 1 10221 COMMIT
master-bin.000001 10221 Query 1 10285 BEGIN master-bin.000001 10221 Query 1 10285 BEGIN
master-bin.000001 10285 Table_map 1 65 cluster_replication.apply_status master-bin.000001 10285 Table_map 1 40 table_id: # (test.t1)
master-bin.000001 10350 Write_rows 1 107 master-bin.000001 10325 Table_map 1 105 table_id: # (cluster_replication.apply_status)
master-bin.000001 10392 Query 1 10457 COMMIT master-bin.000001 10390 Write_rows 1 147 table_id: # flags: STMT_END_F
master-bin.000001 10457 Query 1 10533 use `test`; drop table t1 master-bin.000001 10432 Query 1 10497 COMMIT
master-bin.000001 10533 Query 1 10708 use `test`; create table t1 ( master-bin.000001 10497 Query 1 10573 use `test`; drop table t1
master-bin.000001 10573 Query 1 10748 use `test`; create table t1 (
a int not null primary key, a int not null primary key,
b text not null, b text not null,
c int, c int,
d longblob, d longblob,
e tinyblob e tinyblob
) engine=ndbcluster ) engine=ndbcluster
master-bin.000001 10708 Query 1 10772 BEGIN master-bin.000001 10748 Query 1 10812 BEGIN
master-bin.000001 10772 Table_map 1 65 cluster_replication.apply_status master-bin.000001 10812 Table_map 1 43 table_id: # (test.t1)
master-bin.000001 10837 Write_rows 1 107 master-bin.000001 10855 Table_map 1 108 table_id: # (cluster_replication.apply_status)
master-bin.000001 10879 Table_map 1 150 test.t1 master-bin.000001 10920 Write_rows 1 150 table_id: #
master-bin.000001 10922 Write_rows 1 48934 master-bin.000001 10962 Write_rows 1 48934 table_id: #
master-bin.000001 59706 Write_rows 1 124436 master-bin.000001 59746 Write_rows 1 124436 table_id: #
master-bin.000001 135208 Write_rows 1 124542 master-bin.000001 135248 Write_rows 1 124542 table_id: #
master-bin.000001 135314 Write_rows 1 205961 master-bin.000001 135354 Write_rows 1 205961 table_id: #
master-bin.000001 216733 Write_rows 1 224245 master-bin.000001 216773 Write_rows 1 224245 table_id: #
master-bin.000001 235017 Write_rows 1 227523 master-bin.000001 235057 Write_rows 1 227523 table_id: # flags: STMT_END_F
master-bin.000001 238295 Write_rows 1 242391 master-bin.000001 238335 Query 1 238400 COMMIT
master-bin.000001 253163 Write_rows 1 254087 master-bin.000001 238400 Query 1 238464 BEGIN
master-bin.000001 264859 Write_rows 1 304335 master-bin.000001 238464 Table_map 1 43 table_id: # (test.t1)
master-bin.000001 315107 Write_rows 1 330427 master-bin.000001 238507 Table_map 1 108 table_id: # (cluster_replication.apply_status)
master-bin.000001 341199 Query 1 341264 COMMIT master-bin.000001 238572 Write_rows 1 150 table_id: #
master-bin.000001 341264 Query 1 341328 BEGIN master-bin.000001 238614 Write_rows 1 15018 table_id: #
master-bin.000001 341328 Table_map 1 65 cluster_replication.apply_status master-bin.000001 253482 Write_rows 1 26714 table_id: #
master-bin.000001 341393 Write_rows 1 107 master-bin.000001 265178 Write_rows 1 76962 table_id: #
master-bin.000001 341435 Query 1 341500 COMMIT master-bin.000001 315426 Write_rows 1 103054 table_id: # flags: STMT_END_F
master-bin.000001 341500 Query 1 341576 use `test`; drop table t1 master-bin.000001 341518 Query 1 341583 COMMIT
master-bin.000001 341583 Query 1 341659 use `test`; drop table t1
...@@ -57,10 +57,10 @@ master-bin.000001 798 Query 1 978 use `test`; CREATE TABLE t1 ...@@ -57,10 +57,10 @@ master-bin.000001 798 Query 1 978 use `test`; CREATE TABLE t1
tablespace ts1 storage disk tablespace ts1 storage disk
engine ndb engine ndb
master-bin.000001 978 Query 1 1042 BEGIN master-bin.000001 978 Query 1 1042 BEGIN
master-bin.000001 1042 Table_map 1 65 cluster_replication.apply_status master-bin.000001 1042 Table_map 1 41 table_id: # (test.t1)
master-bin.000001 1107 Write_rows 1 107 master-bin.000001 1083 Table_map 1 106 table_id: # (cluster_replication.apply_status)
master-bin.000001 1149 Table_map 1 148 test.t1 master-bin.000001 1148 Write_rows 1 148 table_id: #
master-bin.000001 1190 Write_rows 1 190 master-bin.000001 1190 Write_rows 1 190 table_id: # flags: STMT_END_F
master-bin.000001 1232 Query 1 1297 COMMIT master-bin.000001 1232 Query 1 1297 COMMIT
drop table t1; drop table t1;
alter tablespace ts1 alter tablespace ts1
......
...@@ -363,7 +363,6 @@ SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; ...@@ -363,7 +363,6 @@ SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
C1 HEX(B1) HEX(B2) C1 HEX(B1) HEX(B2)
1 NULL 0 1 NULL 0
CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'NDB' ; CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'NDB' ;
--- on slave: original values --- --- on slave: original values ---
INSERT INTO t7 VALUES (1,3), (2,6), (3,9); INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1; SELECT * FROM t7 ORDER BY C1;
...@@ -371,7 +370,6 @@ C1 C2 ...@@ -371,7 +370,6 @@ C1 C2
1 3 1 3
2 6 2 6
3 9 3 9
--- on master: new values inserted --- --- on master: new values inserted ---
INSERT INTO t7 VALUES (1,2), (2,4), (3,6); INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
SELECT * FROM t7 ORDER BY C1; SELECT * FROM t7 ORDER BY C1;
...@@ -379,48 +377,42 @@ C1 C2 ...@@ -379,48 +377,42 @@ C1 C2
1 2 1 2
2 4 2 4
3 6 3 6
--- on slave: old values should be overwritten by replicated values --- --- on slave: old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1; SELECT * FROM t7 ORDER BY C1;
C1 C2 C1 C2
1 2 1 2
2 4 2 4
3 6 3 6
--- on master --- --- on master ---
DROP TABLE t7; CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'NDB' ;
CREATE TABLE t7 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'NDB' ; INSERT INTO t8 VALUES (99,99,99);
INSERT INTO t7 VALUES (99,99,99); INSERT INTO t8 VALUES (99,22,33);
INSERT INTO t7 VALUES (99,22,33);
ERROR 23000: Duplicate entry '99' for key 'PRIMARY' ERROR 23000: Duplicate entry '99' for key 'PRIMARY'
INSERT INTO t7 VALUES (11,99,33); INSERT INTO t8 VALUES (11,99,33);
ERROR 23000: Duplicate entry '11' for key 'PRIMARY' ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
INSERT INTO t7 VALUES (11,22,99); INSERT INTO t8 VALUES (11,22,99);
ERROR 23000: Duplicate entry '11' for key 'PRIMARY' ERROR 23000: Duplicate entry '11' for key 'PRIMARY'
SELECT * FROM t7 ORDER BY a; SELECT * FROM t8 ORDER BY a;
a b c a b c
99 99 99 99 99 99
--- on slave --- --- on slave ---
SELECT * FROM t7 ORDER BY a; SELECT * FROM t8 ORDER BY a;
a b c a b c
99 99 99 99 99 99
INSERT INTO t7 VALUES (1,2,3), (2,4,6), (3,6,9); INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
SELECT * FROM t7 ORDER BY a; SELECT * FROM t8 ORDER BY a;
a b c a b c
1 2 3 1 2 3
2 4 6 2 4 6
3 6 9 3 6 9
99 99 99 99 99 99
--- on master --- --- on master ---
INSERT INTO t7 VALUES (2,4,8); INSERT INTO t8 VALUES (2,4,8);
--- on slave --- --- on slave ---
SELECT * FROM t7 ORDER BY a; SELECT * FROM t8 ORDER BY a;
a b c a b c
1 2 3 1 2 3
2 4 8 2 4 8
3 6 9 3 6 9
99 99 99 99 99 99
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7; DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
...@@ -41,6 +41,12 @@ t1 ...@@ -41,6 +41,12 @@ t1
t2 t2
**** On Master **** **** On Master ****
DROP TABLE t1,t2; DROP TABLE t1,t2;
SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 188 use `test`; CREATE TABLE t1 (a int)
master-bin.000001 188 Query 1 274 use `test`; CREATE TABLE t2 (a int)
master-bin.000001 274 Query 1 378 use `test`; DROP TABLE `t1` /* generated by server */
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
t2 t2
......
...@@ -16,7 +16,6 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines; ...@@ -16,7 +16,6 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
69 69
drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
...@@ -27,7 +26,6 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 ...@@ -27,7 +26,6 @@ master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `test`; drop table t1
show binlog events from 102 limit 1; show binlog events from 102 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM
...@@ -39,14 +37,12 @@ show binlog events from 102 limit 2,1; ...@@ -39,14 +37,12 @@ show binlog events from 102 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
flush logs; flush logs;
create table t5 (a int)ENGINE=MyISAM; create table t3 (a int)ENGINE=MyISAM;
drop table t5;
start slave; start slave;
flush logs; flush logs;
stop slave; stop slave;
create table t1 (n int)ENGINE=MyISAM; create table t2 (n int)ENGINE=MyISAM;
insert into t1 values (1); insert into t2 values (1);
drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
...@@ -57,28 +53,25 @@ master-bin.000001 # Query 1 # use `test`; drop table t1 ...@@ -57,28 +53,25 @@ master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000002 # Table_map 1 # table_id: # (mysql.slow_log) master-bin.000002 # Table_map 1 # table_id: # (mysql.slow_log)
master-bin.000002 # Table_map 1 # table_id: # (mysql.general_log) master-bin.000002 # Table_map 1 # table_id: # (mysql.general_log)
master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; drop table t5 master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM master-bin.000002 # Table_map 1 # table_id: # (test.t2)
master-bin.000002 # Table_map 1 # table_id: # (test.t1)
master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Query 1 # use `test`; drop table t1
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1332 master-bin.000001 1256
master-bin.000002 635 master-bin.000002 483
start slave; start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1506 slave-bin.000001 1354
slave-bin.000002 460 slave-bin.000002 384
show binlog events in 'slave-bin.000001' from 4; show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
...@@ -89,21 +82,21 @@ slave-bin.000001 # Query 1 # use `test`; drop table t1 ...@@ -89,21 +82,21 @@ slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM
slave-bin.000001 # Table_map 1 # table_id: # (test.t1) slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Query 1 # use `test`; drop table t1 slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM
slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=MyISAM
slave-bin.000001 # Query 1 # use `test`; drop table t5
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4; show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Table_map 2 # table_id: # (mysql.slow_log) slave-bin.000002 # Table_map 2 # table_id: # (mysql.slow_log)
slave-bin.000002 # Table_map 2 # table_id: # (mysql.general_log) slave-bin.000002 # Table_map 2 # table_id: # (mysql.general_log)
slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=MyISAM slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM
slave-bin.000002 # Table_map 1 # table_id: # (test.t1) slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000002 # Query 1 # use `test`; drop table t1
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 635 # # master-bin.000002 Yes Yes # 0 0 635 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 483 # # master-bin.000002 Yes Yes # 0 0 483 # None 0 No #
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
...@@ -16,7 +16,6 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines; ...@@ -16,7 +16,6 @@ load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
select count(*) from t1; select count(*) from t1;
count(*) count(*)
69 69
drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
...@@ -29,7 +28,6 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul ...@@ -29,7 +28,6 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Xid 1 # COMMIT /* XID */ master-bin.000001 # Xid 1 # COMMIT /* XID */
master-bin.000001 # Query 1 # use `test`; drop table t1
show binlog events from 102 limit 1; show binlog events from 102 limit 1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB
...@@ -41,14 +39,12 @@ show binlog events from 102 limit 2,1; ...@@ -41,14 +39,12 @@ show binlog events from 102 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
flush logs; flush logs;
create table t5 (a int)ENGINE=InnoDB; create table t3 (a int)ENGINE=InnoDB;
drop table t5;
start slave; start slave;
flush logs; flush logs;
stop slave; stop slave;
create table t1 (n int)ENGINE=InnoDB; create table t2 (n int)ENGINE=InnoDB;
insert into t1 values (1); insert into t2 values (1);
drop table t1;
show binlog events; show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
...@@ -61,29 +57,26 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul ...@@ -61,29 +57,26 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not nul
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Xid 1 # COMMIT /* XID */ master-bin.000001 # Xid 1 # COMMIT /* XID */
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Rotate 1 # master-bin.000002;pos=4 master-bin.000001 # Rotate 1 # master-bin.000002;pos=4
show binlog events in 'master-bin.000002'; show binlog events in 'master-bin.000002';
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000002 # Table_map 1 # table_id: # (mysql.slow_log) master-bin.000002 # Table_map 1 # table_id: # (mysql.slow_log)
master-bin.000002 # Table_map 1 # table_id: # (mysql.general_log) master-bin.000002 # Table_map 1 # table_id: # (mysql.general_log)
master-bin.000002 # Query 1 # use `test`; create table t5 (a int)ENGINE=InnoDB master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
master-bin.000002 # Query 1 # use `test`; drop table t5 master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
master-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=InnoDB master-bin.000002 # Table_map 1 # table_id: # (test.t2)
master-bin.000002 # Table_map 1 # table_id: # (test.t1)
master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000002 # Xid 1 # COMMIT /* XID */ master-bin.000002 # Xid 1 # COMMIT /* XID */
master-bin.000002 # Query 1 # use `test`; drop table t1
show binary logs; show binary logs;
Log_name File_size Log_name File_size
master-bin.000001 1386 master-bin.000001 1310
master-bin.000002 662 master-bin.000002 510
start slave; start slave;
show binary logs; show binary logs;
Log_name File_size Log_name File_size
slave-bin.000001 1560 slave-bin.000001 1408
slave-bin.000002 487 slave-bin.000002 411
show binlog events in 'slave-bin.000001' from 4; show binlog events in 'slave-bin.000001' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
...@@ -96,22 +89,22 @@ slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null ...@@ -96,22 +89,22 @@ slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null
slave-bin.000001 # Table_map 1 # table_id: # (test.t1) slave-bin.000001 # Table_map 1 # table_id: # (test.t1)
slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000001 # Xid 1 # COMMIT /* XID */ slave-bin.000001 # Xid 1 # COMMIT /* XID */
slave-bin.000001 # Query 1 # use `test`; drop table t1 slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=InnoDB
slave-bin.000001 # Query 1 # use `test`; create table t5 (a int)ENGINE=InnoDB
slave-bin.000001 # Query 1 # use `test`; drop table t5
slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
show binlog events in 'slave-bin.000002' from 4; show binlog events in 'slave-bin.000002' from 4;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Table_map 2 # table_id: # (mysql.slow_log) slave-bin.000002 # Table_map 2 # table_id: # (mysql.slow_log)
slave-bin.000002 # Table_map 2 # table_id: # (mysql.general_log) slave-bin.000002 # Table_map 2 # table_id: # (mysql.general_log)
slave-bin.000002 # Query 1 # use `test`; create table t1 (n int)ENGINE=InnoDB slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=InnoDB
slave-bin.000002 # Table_map 1 # table_id: # (test.t1) slave-bin.000002 # Table_map 1 # table_id: # (test.t2)
slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000002 # Write_rows 1 # table_id: # flags: STMT_END_F
slave-bin.000002 # Xid 1 # COMMIT /* XID */ slave-bin.000002 # Xid 1 # COMMIT /* XID */
slave-bin.000002 # Query 1 # use `test`; drop table t1
show slave status; show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 662 # # master-bin.000002 Yes Yes # 0 0 662 # None 0 No # # 127.0.0.1 root MASTER_PORT 1 master-bin.000002 510 # # master-bin.000002 Yes Yes # 0 0 510 # None 0 No #
show binlog events in 'slave-bin.000005' from 4; show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
...@@ -29,17 +29,5 @@ a ...@@ -29,17 +29,5 @@ a
SELECT * FROM test.t2; SELECT * FROM test.t2;
a a
2 2
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 4 Format_desc 1 102 Server ver: VERSION, Binlog ver: 4
master-bin.000001 102 Query 1 193 use `test`; DROP TABLE IF EXISTS test.t2
master-bin.000001 193 Query 1 299 use `test`; CREATE TABLE test.t1 (a INT,PRIMARY KEY(a))
master-bin.000001 299 Query 1 405 use `test`; CREATE TABLE test.t2 (a INT,PRIMARY KEY(a))
master-bin.000001 405 Table_map 1 444 table_id: # (test.t1)
master-bin.000001 444 Write_rows 1 483 table_id: # flags: STMT_END_F
master-bin.000001 483 Table_map 1 540 table_id: # (mysql.proc)
master-bin.000001 540 Write_rows 1 723 table_id: # flags: STMT_END_F
master-bin.000001 723 Table_map 1 762 table_id: # (test.t2)
master-bin.000001 762 Write_rows 1 796 table_id: # flags: STMT_END_F
DROP PROCEDURE IF EXISTS test.p1; DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1; DROP TABLE IF EXISTS test.t1;
...@@ -140,62 +140,65 @@ a ...@@ -140,62 +140,65 @@ a
show binlog events from 102; show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Query 1 205 drop database if exists mysqltest1 master-bin.000001 102 Query 1 205 drop database if exists mysqltest1
master-bin.000001 205 Query 1 300 create database mysqltest1 master-bin.000001 205 Table_map 1 262 table_id: 15 (mysql.proc)
master-bin.000001 300 Query 1 401 use `mysqltest1`; CREATE TABLE t1 (a varchar(100)) master-bin.000001 262 Write_rows 1 291 table_id: 4294967295 flags: STMT_END_F
master-bin.000001 401 Table_map 1 446 mysqltest1.t1 master-bin.000001 291 Table_map 1 349 table_id: 16 (mysql.event)
master-bin.000001 446 Write_rows 1 481 master-bin.000001 349 Write_rows 1 378 table_id: 4294967295 flags: STMT_END_F
master-bin.000001 481 Table_map 1 526 mysqltest1.t1 master-bin.000001 378 Query 1 473 create database mysqltest1
master-bin.000001 526 Write_rows 1 602 master-bin.000001 473 Query 1 574 use `mysqltest1`; CREATE TABLE t1 (a varchar(100))
master-bin.000001 602 Table_map 1 647 mysqltest1.t1 master-bin.000001 574 Table_map 1 619 table_id: 17 (mysqltest1.t1)
master-bin.000001 647 Write_rows 1 718 master-bin.000001 619 Write_rows 1 648 table_id: 4294967295 flags: STMT_END_F
master-bin.000001 718 Table_map 1 763 mysqltest1.t1 master-bin.000001 648 Table_map 1 693 table_id: 17 (mysqltest1.t1)
master-bin.000001 763 Write_rows 1 803 master-bin.000001 693 Write_rows 1 728 table_id: 17 flags: STMT_END_F
master-bin.000001 803 Table_map 1 848 mysqltest1.t1 master-bin.000001 728 Table_map 1 773 table_id: 17 (mysqltest1.t1)
master-bin.000001 848 Write_rows 1 918 master-bin.000001 773 Write_rows 1 849 table_id: 17 flags: STMT_END_F
master-bin.000001 918 Table_map 1 963 mysqltest1.t1 master-bin.000001 849 Table_map 1 894 table_id: 17 (mysqltest1.t1)
master-bin.000001 963 Write_rows 1 1003 master-bin.000001 894 Write_rows 1 923 table_id: 4294967295 flags: STMT_END_F
master-bin.000001 1003 Table_map 1 1048 mysqltest1.t1 master-bin.000001 923 Table_map 1 968 table_id: 17 (mysqltest1.t1)
master-bin.000001 1048 Write_rows 1 1082 master-bin.000001 968 Write_rows 1 1039 table_id: 17 flags: STMT_END_F
master-bin.000001 1082 Query 1 1180 use `mysqltest1`; insert into t1 values("work") master-bin.000001 1039 Table_map 1 1084 table_id: 17 (mysqltest1.t1)
master-bin.000001 1180 User var 1 1228 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 1084 Write_rows 1 1124 table_id: 17 flags: STMT_END_F
master-bin.000001 1228 Query 1 1328 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 1124 Table_map 1 1169 table_id: 17 (mysqltest1.t1)
master-bin.000001 1328 Query 1 1426 use `mysqltest1`; insert into t1 values("work") master-bin.000001 1169 Write_rows 1 1239 table_id: 17 flags: STMT_END_F
master-bin.000001 1426 User var 1 1474 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 1239 Table_map 1 1284 table_id: 17 (mysqltest1.t1)
master-bin.000001 1474 Query 1 1574 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 1284 Write_rows 1 1324 table_id: 17 flags: STMT_END_F
master-bin.000001 1574 Query 1 1671 use `mysqltest1`; insert into t1 values("for") master-bin.000001 1324 Table_map 1 1369 table_id: 17 (mysqltest1.t1)
master-bin.000001 1671 Query 1 1773 use `mysqltest1`; insert into t1 select "yesterday" master-bin.000001 1369 Write_rows 1 1403 table_id: 17 flags: STMT_END_F
master-bin.000001 1773 Query 1 1871 use `mysqltest1`; insert into t1 values("work") master-bin.000001 1403 Query 1 1501 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 1871 User var 1 1919 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 1501 User var 1 1549 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 1919 Query 1 2019 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 1549 Query 1 1649 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 2019 Query 1 2117 use `mysqltest1`; insert into t1 values("work") master-bin.000001 1649 Query 1 1747 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 2117 User var 1 2165 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 1747 User var 1 1795 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 2165 Query 1 2265 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 1795 Query 1 1895 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 2265 Query 1 2362 use `mysqltest1`; insert into t1 values("for") master-bin.000001 1895 Query 1 1992 use `mysqltest1`; insert into t1 values("for")
master-bin.000001 2362 Query 1 2464 use `mysqltest1`; insert into t1 select "yesterday" master-bin.000001 1992 Query 1 2094 use `mysqltest1`; insert into t1 select "yesterday"
master-bin.000001 2464 Query 1 2562 use `mysqltest1`; insert into t1 values("work") master-bin.000001 2094 Query 1 2192 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 2562 Table_map 1 2607 mysqltest1.t1 master-bin.000001 2192 User var 1 2240 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 2607 Write_rows 1 2683 master-bin.000001 2240 Query 1 2340 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 2683 Table_map 1 2728 mysqltest1.t1 master-bin.000001 2340 Query 1 2438 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 2728 Write_rows 1 2799 master-bin.000001 2438 User var 1 2486 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 2799 User var 1 2847 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 2486 Query 1 2586 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 2847 Query 1 2947 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 2586 Query 1 2683 use `mysqltest1`; insert into t1 values("for")
master-bin.000001 2947 Table_map 1 2992 mysqltest1.t1 master-bin.000001 2683 Query 1 2785 use `mysqltest1`; insert into t1 select "yesterday"
master-bin.000001 2992 Write_rows 1 3062 master-bin.000001 2785 Query 1 2883 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 3062 Query 1 3164 use `mysqltest1`; insert into t1 select "yesterday" master-bin.000001 2883 Write_rows 1 2959 table_id: 17 flags: STMT_END_F
master-bin.000001 3164 Table_map 1 3209 mysqltest1.t1 master-bin.000001 2959 Write_rows 1 3030 table_id: 17 flags: STMT_END_F
master-bin.000001 3209 Write_rows 1 3280 master-bin.000001 3030 User var 1 3078 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 3280 User var 1 3328 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci master-bin.000001 3078 Query 1 3178 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 3328 Query 1 3428 use `mysqltest1`; insert into t1 select @'string' master-bin.000001 3178 Write_rows 1 3248 table_id: 17 flags: STMT_END_F
master-bin.000001 3428 Table_map 1 3473 mysqltest1.t1 master-bin.000001 3248 Query 1 3350 use `mysqltest1`; insert into t1 select "yesterday"
master-bin.000001 3473 Write_rows 1 3543 master-bin.000001 3350 Write_rows 1 3421 table_id: 17 flags: STMT_END_F
master-bin.000001 3543 Query 1 3645 use `mysqltest1`; insert into t1 select "yesterday" master-bin.000001 3421 User var 1 3469 @`string`=_latin1 0x656D657267656E6379 COLLATE latin1_swedish_ci
master-bin.000001 3645 Query 1 3857 use `mysqltest1`; create procedure foo() master-bin.000001 3469 Query 1 3569 use `mysqltest1`; insert into t1 select @'string'
master-bin.000001 3569 Write_rows 1 3639 table_id: 17 flags: STMT_END_F
master-bin.000001 3639 Query 1 3741 use `mysqltest1`; insert into t1 select "yesterday"
master-bin.000001 3741 Query 1 3953 use `mysqltest1`; create procedure foo()
begin begin
insert into t1 values("work"); insert into t1 values("work");
insert into t1 values(concat("for",UUID())); insert into t1 values(concat("for",UUID()));
insert into t1 select "yesterday"; insert into t1 select "yesterday";
end end
master-bin.000001 3857 Query 1 4214 use `mysqltest1`; create procedure foo2() master-bin.000001 3953 Query 1 4310 use `mysqltest1`; create procedure foo2()
begin begin
insert into t1 values(concat("emergency",UUID())); insert into t1 values(concat("emergency",UUID()));
insert into t1 values("work"); insert into t1 values("work");
...@@ -204,21 +207,18 @@ set session binlog_format=row; # accepted for stored procs ...@@ -204,21 +207,18 @@ set session binlog_format=row; # accepted for stored procs
insert into t1 values("more work"); insert into t1 values("more work");
set session binlog_format=mixed; set session binlog_format=mixed;
end end
master-bin.000001 4214 Query 1 4442 use `mysqltest1`; create function foo3() returns bigint unsigned master-bin.000001 4310 Query 1 4538 use `mysqltest1`; create function foo3() returns bigint unsigned
begin begin
set session binlog_format=row; # rejected for stored funcs set session binlog_format=row; # rejected for stored funcs
insert into t1 values("alarm"); insert into t1 values("alarm");
return 100; return 100;
end end
master-bin.000001 4442 Query 1 4548 use `mysqltest1`; insert into t1 values("work") master-bin.000001 4538 Query 1 4644 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 4548 Table_map 1 4593 mysqltest1.t1 master-bin.000001 4644 Write_rows 1 4714 table_id: 17 flags: STMT_END_F
master-bin.000001 4593 Write_rows 1 4663 master-bin.000001 4714 Query 1 4824 use `mysqltest1`; insert into t1 select "yesterday"
master-bin.000001 4663 Query 1 4773 use `mysqltest1`; insert into t1 select "yesterday" master-bin.000001 4824 Write_rows 1 4900 table_id: 17 flags: STMT_END_F
master-bin.000001 4773 Table_map 1 4818 mysqltest1.t1 master-bin.000001 4900 Query 1 5006 use `mysqltest1`; insert into t1 values("work")
master-bin.000001 4818 Write_rows 1 4894 master-bin.000001 5006 Write_rows 1 5076 table_id: 17 flags: STMT_END_F
master-bin.000001 4894 Query 1 5000 use `mysqltest1`; insert into t1 values("work") master-bin.000001 5076 Table_map 1 5121 table_id: 17 (mysqltest1.t1)
master-bin.000001 5000 Table_map 1 5045 mysqltest1.t1 master-bin.000001 5121 Write_rows 1 5161 table_id: 17 flags: STMT_END_F
master-bin.000001 5045 Write_rows 1 5115
master-bin.000001 5115 Table_map 1 5160 mysqltest1.t1
master-bin.000001 5160 Write_rows 1 5200
drop database mysqltest1; drop database mysqltest1;
...@@ -2959,8 +2959,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) ...@@ -2959,8 +2959,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
const LEX_STRING& name=table->s->table_name; const LEX_STRING& name=table->s->table_name;
DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str)); DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str));
injector::transaction::table tbl(table, true); injector::transaction::table tbl(table, true);
// TODO enable when mats patch pushed trans.use_table(::server_id, tbl);
//trans.use_table(::server_id, tbl);
} }
} }
gci= pOp->getGCI(); gci= pOp->getGCI();
...@@ -2971,8 +2970,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) ...@@ -2971,8 +2970,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
const LEX_STRING& name=table->s->table_name; const LEX_STRING& name=table->s->table_name;
DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str)); DBUG_PRINT("info", ("use_table: %.*s", name.length, name.str));
injector::transaction::table tbl(table, true); injector::transaction::table tbl(table, true);
// TODO enable when mats patch pushed trans.use_table(::server_id, tbl);
//trans.use_table(::server_id, tbl);
MY_BITMAP b; MY_BITMAP b;
uint32 bitbuf; uint32 bitbuf;
......
...@@ -3137,10 +3137,11 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) ...@@ -3137,10 +3137,11 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
correct for the table. correct for the table.
A row in the given table should be replicated if: A row in the given table should be replicated if:
- Row-based replication is on - Row-based replication is enabled in the current thread
- It is not a temporary table
- The binlog is enabled - The binlog is enabled
- The table shall be binlogged (binlog_*_db rules) - It is not a temporary table
- The binary log is open
- The database the table resides in shall be binlogged (binlog_*_db rules)
*/ */
#ifdef HAVE_ROW_BASED_REPLICATION #ifdef HAVE_ROW_BASED_REPLICATION
...@@ -3154,6 +3155,7 @@ namespace { ...@@ -3154,6 +3155,7 @@ namespace {
thd->current_stmt_binlog_row_based && thd->current_stmt_binlog_row_based &&
thd && (thd->options & OPTION_BIN_LOG) && thd && (thd->options & OPTION_BIN_LOG) &&
(table->s->tmp_table == NO_TMP_TABLE) && (table->s->tmp_table == NO_TMP_TABLE) &&
mysql_bin_log.is_open() &&
binlog_filter->db_ok(table->s->db.str); binlog_filter->db_ok(table->s->db.str);
} }
} }
......
...@@ -2613,7 +2613,7 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans) ...@@ -2613,7 +2613,7 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans)
table, table->s->table_name, table->s->table_map_id)); table, table->s->table_name, table->s->table_map_id));
/* Pre-conditions */ /* Pre-conditions */
DBUG_ASSERT(binlog_row_based && mysql_bin_log.is_open()); DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open());
DBUG_ASSERT(table->s->table_map_id != ULONG_MAX); DBUG_ASSERT(table->s->table_map_id != ULONG_MAX);
Table_map_log_event::flag_set const Table_map_log_event::flag_set const
......
...@@ -5334,7 +5334,7 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) ...@@ -5334,7 +5334,7 @@ int Rows_log_event::exec_event(st_relay_log_info *rli)
need to add code to assert that is the case. need to add code to assert that is the case.
*/ */
thd->binlog_flush_pending_rows_event(false); thd->binlog_flush_pending_rows_event(false);
close_tables_for_reopen(thd, rli->tables_to_lock); close_tables_for_reopen(thd, &rli->tables_to_lock);
if ((error= open_tables(thd, &rli->tables_to_lock, if ((error= open_tables(thd, &rli->tables_to_lock,
&rli->tables_to_lock_count, 0))) &rli->tables_to_lock_count, 0)))
......
...@@ -2308,8 +2308,9 @@ st_relay_log_info::st_relay_log_info() ...@@ -2308,8 +2308,9 @@ st_relay_log_info::st_relay_log_info()
ignore_log_space_limit(0), last_master_timestamp(0), slave_skip_counter(0), ignore_log_space_limit(0), last_master_timestamp(0), slave_skip_counter(0),
abort_pos_wait(0), slave_run_id(0), sql_thd(0), last_slave_errno(0), abort_pos_wait(0), slave_run_id(0), sql_thd(0), last_slave_errno(0),
inited(0), abort_slave(0), slave_running(0), until_condition(UNTIL_NONE), inited(0), abort_slave(0), slave_running(0), until_condition(UNTIL_NONE),
until_log_pos(0), retried_trans(0), m_reload_flags(RELOAD_NONE_F), until_log_pos(0), retried_trans(0),
tables_to_lock(0), tables_to_lock_count(0), tables_to_lock(0), tables_to_lock_count(0),
m_reload_flags(RELOAD_NONE_F),
unsafe_to_stop_at(0) unsafe_to_stop_at(0)
{ {
group_relay_log_name[0]= event_relay_log_name[0]= group_relay_log_name[0]= event_relay_log_name[0]=
......
...@@ -2309,7 +2309,7 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock) ...@@ -2309,7 +2309,7 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock)
(search->locked_by_name && wait_for_name_lock || (search->locked_by_name && wait_for_name_lock ||
search->locked_by_flush || search->locked_by_flush ||
(search->db_stat && search->s->version < refresh_version))) (search->db_stat && search->s->version < refresh_version)))
return 1; DBUG_RETURN(1);
} }
} while ((table=table->next)); } while ((table=table->next));
DBUG_RETURN(0); DBUG_RETURN(0);
......
...@@ -2508,7 +2508,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) ...@@ -2508,7 +2508,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
MY_HOOKS(select_create *x) : ptr(x) { } MY_HOOKS(select_create *x) : ptr(x) { }
virtual void do_prelock(TABLE **tables, uint count) virtual void do_prelock(TABLE **tables, uint count)
{ {
if (binlog_row_based) if (ptr->thd->current_stmt_binlog_row_based)
ptr->binlog_show_create_table(tables, count); ptr->binlog_show_create_table(tables, count);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment