From: Marc Alff Date: November 12 2012 10:11pm Subject: bzr push into mysql-trunk branch (marc.alff:4977 to 4978) List-Archive: http://lists.mysql.com/commits/145241 Message-Id: <201211122211.qACMBI5L025579@acsmt357.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4978 Marc Alff 2012-11-12 [merge] Merge mysql-5.6 --> mysql-trunk modified: mysql-test/suite/perfschema/include/binlog_edge_common.inc mysql-test/suite/perfschema/r/binlog_edge_mix.result mysql-test/suite/perfschema/r/binlog_edge_row.result mysql-test/suite/perfschema/r/binlog_edge_stmt.result sql/binlog.cc sql/share/errmsg-utf8.txt 4977 Vasil Dimov 2012-11-12 [merge] Merge mysql-5.6 -> mysql-trunk === modified file 'mysql-test/suite/perfschema/include/binlog_edge_common.inc' --- a/mysql-test/suite/perfschema/include/binlog_edge_common.inc 2012-11-08 21:40:31 +0000 +++ b/mysql-test/suite/perfschema/include/binlog_edge_common.inc 2012-11-12 20:59:50 +0000 @@ -4,11 +4,13 @@ # Changes affecting non replicated tables are never written to the binlog. # Executing these statements may or may not work, as the statements involved # are edge cases. -# In STATEMENT binlog format, execution should break with -# error ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES. # In MIXED or ROW binlog format, execution should succeed, # and only partial data (the rows affecting replicated tables only) # should be written to the binlog. +# In STATEMENT binlog format, execution should +# raise a warning (ER_BINLOG_UNSAFE_STATEMENT) if a non replicated table is +# only read from, or fail with an error (ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES) +# if a non replicated table is written to. # # SHOW ERRORS will print in the # test .result file the exact outcome. @@ -19,6 +21,8 @@ RESET MASTER; drop database if exists my_replicated_db; --enable_warnings +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); + create database my_replicated_db; create table my_replicated_db.my_tx_table(a bigint) engine = innodb; @@ -51,20 +55,14 @@ use my_replicated_db; # - non replicated tables # - replicated tables ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select thread_id from performance_schema.threads; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select thread_id from performance_schema.threads; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select thread_id from performance_schema.threads; -show errors; # For the information_schema, # no error is enforced yet. @@ -79,80 +77,50 @@ insert into my_non_tx_table(a) insert into my_bh_table(a) select id from information_schema.processlist; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select thread_id from mysql.general_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select thread_id from mysql.general_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select thread_id from mysql.general_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select thread_id from mysql.slow_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select thread_id from mysql.slow_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select thread_id from mysql.slow_log; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; ---error 0, ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES insert into my_bh_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; use test; drop table if exists marker_multi_update; === modified file 'mysql-test/suite/perfschema/r/binlog_edge_mix.result' --- a/mysql-test/suite/perfschema/r/binlog_edge_mix.result 2012-11-08 21:40:31 +0000 +++ b/mysql-test/suite/perfschema/r/binlog_edge_mix.result 2012-11-12 20:59:50 +0000 @@ -1,6 +1,7 @@ set binlog_format=mixed; RESET MASTER; drop database if exists my_replicated_db; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create database my_replicated_db; create table my_replicated_db.my_tx_table(a bigint) engine = innodb; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam; @@ -23,16 +24,10 @@ Note 1051 Unknown table 'test.marker_ins use my_replicated_db; insert into my_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_tx_table(a) select id from information_schema.processlist; insert into my_non_tx_table(a) @@ -41,64 +36,34 @@ insert into my_bh_table(a) select id from information_schema.processlist; insert into my_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_bh_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_bh_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message insert into my_bh_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message use test; drop table if exists marker_multi_update; Warnings: @@ -144,6 +109,9 @@ drop database my_replicated_db; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists my_replicated_db +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # create database my_replicated_db master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam === modified file 'mysql-test/suite/perfschema/r/binlog_edge_row.result' --- a/mysql-test/suite/perfschema/r/binlog_edge_row.result 2012-11-08 21:40:31 +0000 +++ b/mysql-test/suite/perfschema/r/binlog_edge_row.result 2012-11-12 20:59:50 +0000 @@ -1,6 +1,7 @@ set binlog_format=row; RESET MASTER; drop database if exists my_replicated_db; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create database my_replicated_db; create table my_replicated_db.my_tx_table(a bigint) engine = innodb; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam; @@ -23,16 +24,10 @@ Note 1051 Unknown table 'test.marker_ins use my_replicated_db; insert into my_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message insert into my_tx_table(a) select id from information_schema.processlist; insert into my_non_tx_table(a) @@ -41,64 +36,34 @@ insert into my_bh_table(a) select id from information_schema.processlist; insert into my_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message insert into my_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_non_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_bh_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message insert into my_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_bh_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message insert into my_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_bh_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message insert into my_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message insert into my_bh_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message use test; drop table if exists marker_multi_update; Warnings: @@ -144,6 +109,10 @@ drop database my_replicated_db; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists my_replicated_db +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (mtr.test_suppressions) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # create database my_replicated_db master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam === modified file 'mysql-test/suite/perfschema/r/binlog_edge_stmt.result' --- a/mysql-test/suite/perfschema/r/binlog_edge_stmt.result 2012-11-09 09:17:23 +0000 +++ b/mysql-test/suite/perfschema/r/binlog_edge_stmt.result 2012-11-12 22:09:49 +0000 @@ -1,6 +1,7 @@ set binlog_format=statement; RESET MASTER; drop database if exists my_replicated_db; +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); create database my_replicated_db; create table my_replicated_db.my_tx_table(a bigint) engine = innodb; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam; @@ -23,19 +24,16 @@ Note 1051 Unknown table 'test.marker_ins use my_replicated_db; insert into my_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select thread_id from performance_schema.threads; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_tx_table(a) select id from information_schema.processlist; insert into my_non_tx_table(a) @@ -44,79 +42,64 @@ insert into my_bh_table(a) select id from information_schema.processlist; insert into my_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select thread_id from mysql.general_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select thread_id from mysql.slow_log; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select Relay_log_pos from mysql.slave_relay_log_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select Master_log_pos from mysql.slave_master_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_non_tx_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. insert into my_bh_table(a) select Relay_log_pos from mysql.slave_worker_info; -show errors; -Level Code Message -Error 1844 Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated. +Warnings: +Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. The statement is unsafe because it uses the general log, slow query log, or performance_schema table(s). This is unsafe because system tables may differ on slaves. use test; drop table if exists marker_multi_update; Warnings: @@ -162,6 +145,9 @@ drop database my_replicated_db; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists my_replicated_db +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # create database my_replicated_db master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_tx_table(a bigint) engine = innodb master-bin.000001 # Query # # use `test`; create table my_replicated_db.my_non_tx_table(a bigint) engine = myisam @@ -182,6 +168,18 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_insert_select` /* generated by server */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select thread_id from performance_schema.threads +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select thread_id from performance_schema.threads +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select thread_id from performance_schema.threads +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) select id from information_schema.processlist master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN @@ -192,6 +190,66 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) select id from information_schema.processlist master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select thread_id from mysql.general_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select thread_id from mysql.general_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select thread_id from mysql.general_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select thread_id from mysql.slow_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select thread_id from mysql.slow_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select thread_id from mysql.slow_log +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select Relay_log_pos from mysql.slave_relay_log_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select Relay_log_pos from mysql.slave_relay_log_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select Relay_log_pos from mysql.slave_relay_log_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select Master_log_pos from mysql.slave_master_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select Master_log_pos from mysql.slave_master_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select Master_log_pos from mysql.slave_master_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_tx_table(a) +select Relay_log_pos from mysql.slave_worker_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_non_tx_table(a) +select Relay_log_pos from mysql.slave_worker_info +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `my_replicated_db`; insert into my_bh_table(a) +select Relay_log_pos from mysql.slave_worker_info +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_update` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_multi_delete` /* generated by server */ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `marker_end` /* generated by server */ === modified file 'sql/binlog.cc' --- a/sql/binlog.cc 2012-11-08 23:03:17 +0000 +++ b/sql/binlog.cc 2012-11-12 22:09:49 +0000 @@ -7012,7 +7012,7 @@ int THD::decide_logging_format(TABLE_LIS */ uint replicated_tables_count= 0; /** - The number of tables used in the current statement, + The number of tables written to in the current statement, that should not be replicated. A table should not be replicated when it is considered 'local' to a MySQL instance. @@ -7024,6 +7024,8 @@ int THD::decide_logging_format(TABLE_LIS - mysql.slave_worker_info - performance_schema.* - TODO: information_schema.* + In practice, from this list, only performance_schema.* tables + are written to by user queries. */ uint non_replicated_tables_count= 0; #ifndef DBUG_OFF @@ -7069,8 +7071,12 @@ int THD::decide_logging_format(TABLE_LIS or it will be logged (possibly partially) in ROW format. */ lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_TABLE); - non_replicated_tables_count++; - continue; + + if (table->lock_type >= TL_WRITE_ALLOW_WRITE) + { + non_replicated_tables_count++; + continue; + } } replicated_tables_count++; === modified file 'sql/share/errmsg-utf8.txt' --- a/sql/share/errmsg-utf8.txt 2012-11-09 09:17:23 +0000 +++ b/sql/share/errmsg-utf8.txt 2012-11-12 22:09:49 +0000 @@ -6903,7 +6903,7 @@ ER_GTID_EXECUTED_WAS_CHANGED eng "GTID_EXECUTED was changed from '%s' to '%s'." ER_BINLOG_STMT_MODE_AND_NO_REPL_TABLES - eng "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table is not replicated." + eng "Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT, and both replicated and non replicated tables are written to." # # End of 5.6 error messages. No bundle (reason: useless for push emails).