Loading mysql-test/extra/binlog_tests/binlog.test +13 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,19 @@ create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; # BUG#25091 (A DELETE statement to mysql database is not logged with # ROW mode format): Checking that some basic operations on tables in # the mysql database is replicated even when the current database is # 'mysql'. --disable_warnings USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; --enable_warnings use test; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// show binlog events from 102; Loading mysql-test/r/binlog_row_binlog.result +17 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,11 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) Loading @@ -262,6 +267,12 @@ master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; Loading @@ -281,6 +292,12 @@ master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Table_map 1 # table_id: # (test.t1) Loading mysql-test/r/binlog_stm_binlog.result +11 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,11 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) Loading @@ -169,6 +174,9 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; Loading @@ -185,6 +193,9 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1 master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Table_map 1 # table_id: # (test.t1) Loading sql/handler.cc +1 −1 Original line number Diff line number Diff line Loading @@ -3456,7 +3456,7 @@ namespace { { int const check(table->s->tmp_table == NO_TMP_TABLE && binlog_filter->db_ok(table->s->db.str) && strcmp("mysql", table->s->db.str) != 0); !table->no_replicate); table->s->cached_row_logging_check= check; } Loading sql/log.cc +1 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,7 @@ bool Log_to_csv_event_handler::open_log_table(uint log_table_type) { table->table->use_all_columns(); table->table->locked_by_logger= TRUE; table->table->no_replicate= TRUE; } /* restore thread settings */ if (curr) Loading Loading
mysql-test/extra/binlog_tests/binlog.test +13 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,19 @@ create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; # BUG#25091 (A DELETE statement to mysql database is not logged with # ROW mode format): Checking that some basic operations on tables in # the mysql database is replicated even when the current database is # 'mysql'. --disable_warnings USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; --enable_warnings use test; --replace_column 2 # 5 # --replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\// show binlog events from 102; Loading
mysql-test/r/binlog_row_binlog.result +17 −0 Original line number Diff line number Diff line Loading @@ -249,6 +249,11 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) Loading @@ -262,6 +267,12 @@ master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; Loading @@ -281,6 +292,12 @@ master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` ( master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` ( `a` int(11) DEFAULT NULL ) master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Update_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Table_map 1 # table_id: # (mysql.user) master-bin.000001 # Delete_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */ master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Table_map 1 # table_id: # (test.t1) Loading
mysql-test/r/binlog_stm_binlog.result +11 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,11 @@ create table t1 (a int); create table if not exists t2 select * from t1; create temporary table tt1 (a int); create table if not exists t3 like tt1; USE mysql; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test'); UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@'; DELETE FROM user WHERE host='localhost' AND user='@#@'; use test; show binlog events from 102; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key) Loading @@ -169,6 +174,9 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; Loading @@ -185,6 +193,9 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1 master-bin.000001 # Query 1 # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') master-bin.000001 # Query 1 # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1 master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Table_map 1 # table_id: # (test.t1) Loading
sql/handler.cc +1 −1 Original line number Diff line number Diff line Loading @@ -3456,7 +3456,7 @@ namespace { { int const check(table->s->tmp_table == NO_TMP_TABLE && binlog_filter->db_ok(table->s->db.str) && strcmp("mysql", table->s->db.str) != 0); !table->no_replicate); table->s->cached_row_logging_check= check; } Loading
sql/log.cc +1 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,7 @@ bool Log_to_csv_event_handler::open_log_table(uint log_table_type) { table->table->use_all_columns(); table->table->locked_by_logger= TRUE; table->table->no_replicate= TRUE; } /* restore thread settings */ if (curr) Loading