summaryrefslogtreecommitdiff
path: root/mysql-test/suite/binlog
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2008-10-23 21:27:09 +0200
committerMats Kindahl <mats@sun.com>2008-10-23 21:27:09 +0200
commit1f29c525818b421bda822550a92cb6f7092dcec8 (patch)
tree09212d65be943c6c5dfd6d6a834841683d81f9f8 /mysql-test/suite/binlog
parentd88716c2cf990ae8e6b2de75612219b22259b3cf (diff)
parent3c76b5a10405a019422a6617be8e6b22a8da8953 (diff)
downloadmariadb-git-1f29c525818b421bda822550a92cb6f7092dcec8.tar.gz
Merging 5.1 main into 5.1-rpl
Diffstat (limited to 'mysql-test/suite/binlog')
-rw-r--r--mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_multi_engine.result31
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result47
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_innodb_stat.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result50
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_blackhole.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result16
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_row.result71
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed.test11
-rw-r--r--mysql-test/suite/binlog/t/binlog_killed_simulate.test4
-rw-r--r--mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test5
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test7
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test2
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_row.test107
14 files changed, 337 insertions, 56 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
new file mode 100644
index 00000000000..ca5067c4e1f
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result
@@ -0,0 +1,25 @@
+flush status;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 0
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 0
+drop table if exists t1;
+create table t1 (a int) engine=innodb;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 2
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+drop table t1;
diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result
index eda3b6b4aaa..281e8785a8d 100644
--- a/mysql-test/suite/binlog/r/binlog_multi_engine.result
+++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result
@@ -43,8 +43,6 @@ INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1n;
@@ -68,25 +66,26 @@ RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
+ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging
show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
-mysqld-bin.000001 # Query # # use `test`; BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1m)
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # use `test`; COMMIT
-mysqld-bin.000001 # Query # # BEGIN
-mysqld-bin.000001 # Table_map # # table_id: # (test.t1n)
-mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
-mysqld-bin.000001 # Write_rows # # table_id: #
-mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
-mysqld-bin.000001 # Query # # COMMIT
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1m)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1b)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
+master-bin.000001 # Query # # BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1n)
+master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status)
+master-bin.000001 # Write_rows # # table_id: #
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # COMMIT
RESET MASTER;
DROP TABLE t1m, t1b, t1n;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 9668c7ce5ea..1a56e048b27 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -1090,6 +1090,53 @@ master-bin.000001 295 Table_map 1 337 table_id: # (test.t1)
master-bin.000001 337 Write_rows 1 383 table_id: # flags: STMT_END_F
master-bin.000001 383 Query 1 452 use `test`; COMMIT
master-bin.000001 452 Query 1 528 use `test`; drop table t1
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END//
+CALL p1();
+c1 c2 c3 d1 d2 d3
+utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
index e6813ee2719..ca5067c4e1f 100644
--- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result
@@ -1,3 +1,4 @@
+flush status;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 0
@@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
-show status like "Innodb_buffer_pool_pages_total";
-Variable_name Value
-Innodb_buffer_pool_pages_total 512
-show status like "Innodb_page_size";
-Variable_name Value
-Innodb_page_size 16384
-show status like "Innodb_rows_deleted";
-Variable_name Value
-Innodb_rows_deleted 2000
-show status like "Innodb_rows_inserted";
-Variable_name Value
-Innodb_rows_inserted 2000
-show status like "Innodb_rows_updated";
-Variable_name Value
-Innodb_rows_updated 0
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index ae8c1e11737..aadbf950b21 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -594,6 +594,56 @@ master-bin.000001 4 Format_desc 1 106 Server version, Binlog ver: 4
master-bin.000001 106 Query 1 227 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned)
master-bin.000001 227 Query 1 351 use `test`; insert into t1 values (9999999999999999,14632475938453979136)
master-bin.000001 351 Query 1 427 use `test`; drop table t1
+reset master;
+CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
+USE bug39182;
+CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END//
+CALL p1();
+c1 c2 c3 d1 d2 d3
+utf8_general_ci utf8_unicode_ci utf8_unicode_ci 2 2 2
+show binlog events from <binlog_start>;
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Query # # CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE TABLE t1 (a VARCHAR(255) COLLATE utf8_unicode_ci)
+DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
+master-bin.000001 # Query # # use `bug39182`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
+BEGIN
+DECLARE s1 VARCHAR(255);
+SET s1= "test";
+CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", s1, "%");
+SELECT
+COLLATION(NAME_CONST('s1', _utf8'test')) c1,
+COLLATION(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) c2,
+COLLATION(s1) c3,
+COERCIBILITY(NAME_CONST('s1', _utf8'test')) d1,
+COERCIBILITY(NAME_CONST('s1', _utf8'test' COLLATE utf8_unicode_ci)) d2,
+COERCIBILITY(s1) d3;
+DROP TEMPORARY TABLE tmp1;
+END
+master-bin.000001 # Query # # use `bug39182`; CREATE TEMPORARY TABLE tmp1
+SELECT * FROM t1 WHERE a LIKE CONCAT("%", NAME_CONST('s1',_utf8'test' COLLATE 'utf8_unicode_ci'), "%")
+master-bin.000001 # Query # # use `bug39182`; DROP TEMPORARY TABLE tmp1
+DROP PROCEDURE p1;
+DROP TABLE t1;
+DROP DATABASE bug39182;
+USE test;
End of 5.0 tests
reset master;
create table t1 (id tinyint auto_increment primary key);
diff --git a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
index 1a3204b9436..1cd77cfbed4 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_blackhole.result
@@ -141,7 +141,6 @@ 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);
-ERROR HY000: Binary logging not possible. Message: Row-based format required for this statement, but not allowed by this combination of engines
DROP TABLE t1;
CREATE TABLE t1(a INT, b INT) ENGINE=BLACKHOLE;
DELETE FROM t1 WHERE a=10;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
index e6813ee2719..ca5067c4e1f 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result
@@ -1,3 +1,4 @@
+flush status;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 0
@@ -22,18 +23,3 @@ show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
drop table t1;
-show status like "Innodb_buffer_pool_pages_total";
-Variable_name Value
-Innodb_buffer_pool_pages_total 512
-show status like "Innodb_page_size";
-Variable_name Value
-Innodb_page_size 16384
-show status like "Innodb_rows_deleted";
-Variable_name Value
-Innodb_rows_deleted 2000
-show status like "Innodb_rows_inserted";
-Variable_name Value
-Innodb_rows_inserted 2000
-show status like "Innodb_rows_updated";
-Variable_name Value
-Innodb_rows_updated 0
diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result
new file mode 100644
index 00000000000..97ec38cfb3e
--- /dev/null
+++ b/mysql-test/suite/binlog/r/binlog_stm_row.result
@@ -0,0 +1,71 @@
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 LIKE t1;
+select @@SESSION.BINLOG_FORMAT;
+@@SESSION.BINLOG_FORMAT
+STATEMENT
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(2);
+#
+# Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
+# lock that will prevent the source table from being modified.
+#
+# con1
+SELECT GET_LOCK('Bug#34306', 120);
+GET_LOCK('Bug#34306', 120)
+1
+# con2
+PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+EXECUTE stmt;;
+# default
+INSERT INTO t2 VALUES (3);;
+# con1
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# con2
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# default
+#
+# Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
+# not prevent the source table from being modified if under RBR.
+#
+# con2
+SET SESSION BINLOG_FORMAT = ROW;
+# con1
+SELECT GET_LOCK('Bug#34306', 120);
+GET_LOCK('Bug#34306', 120)
+1
+# con2
+EXECUTE stmt;;
+# default
+# con1
+INSERT INTO t2 VALUES (4);
+SELECT RELEASE_LOCK('Bug#34306');
+RELEASE_LOCK('Bug#34306')
+1
+# con2
+# default
+# Show binlog events
+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 IF EXISTS t1
+master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2
+master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT)
+master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES(2)
+master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3)
+master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (4)
+master-bin.000001 # Query # # use `test`; BEGIN
+master-bin.000001 # Table_map # # table_id: # (test.t1)
+master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F
+master-bin.000001 # Query # # use `test`; COMMIT
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test
index dc89cc5f7f2..9b30ec4a0db 100644
--- a/mysql-test/suite/binlog/t/binlog_killed.test
+++ b/mysql-test/suite/binlog/t/binlog_killed.test
@@ -1,5 +1,10 @@
-- source include/have_innodb.inc
-- source include/have_binlog_format_mixed_or_statement.inc
+
+# You cannot use `KILL' with the Embedded MySQL Server library,
+# because the embedded server merely runs inside the threads of the host
+# application. -- the docs
+
-- source include/not_embedded.inc
###
@@ -22,6 +27,12 @@ select get_lock("a", 20);
connection con2;
let $ID= `select connection_id()`;
+
+#
+# reset master does not reset binlogging on the embedded server.
+# the test is not run on the embedded for reason of using KILL query.
+# `reset master' problem is to be addressed by bug#15580 fixes.
+#
reset master;
send insert into t2 values (null, null), (null, get_lock("a", 10));
diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
index 789eb6edd69..ec61271ae88 100644
--- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test
+++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test
@@ -34,7 +34,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 1 */`;
eval select $error_code /* must return 1 as query completed before got killed*/;
# cleanup for the sub-case
-system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
#
@@ -62,7 +62,7 @@ let $error_code= `select @a like "%#%error_code=0%" /* must return 0*/`;
eval select $error_code /* must return 0 to mean the killed query is in */;
# cleanup for the sub-case
-system rm $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
+remove_file $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog;
drop table t1,t2;
diff --git a/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
new file mode 100644
index 00000000000..0be097c78ed
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_mix_innodb_stat.test
@@ -0,0 +1,5 @@
+# This is a wrapper for binlog.test so that the same test case can be used
+# For both statement and row based bin logs 9/19/2005 [jbm]
+
+-- source include/have_binlog_format_mixed.inc
+-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test
index bf84eed6ec1..c8136d669e4 100644
--- a/mysql-test/suite/binlog/t/binlog_multi_engine.test
+++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test
@@ -69,9 +69,6 @@ UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
#UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
-UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c;
-
TRUNCATE t1m;
TRUNCATE t1b;
TRUNCATE t1n;
@@ -83,13 +80,11 @@ RESET MASTER;
SET SESSION BINLOG_FORMAT=ROW;
INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2);
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
+
INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2);
INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2);
error ER_BINLOG_LOGGING_IMPOSSIBLE;
-UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c;
-error ER_BINLOG_LOGGING_IMPOSSIBLE;
UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f;
# Not possible to test this since NDB writes its own binlog, which
diff --git a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
index a08039c4a41..c6017246e6d 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_innodb_stat.test
@@ -1,5 +1,5 @@
# This is a wrapper for binlog.test so that the same test case can be used
# For both statement and row based bin logs 9/19/2005 [jbm]
--- source include/have_binlog_format_mixed_or_statement.inc
+-- source include/have_binlog_format_statement.inc
-- source extra/binlog_tests/innodb_stat.test
diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test
new file mode 100644
index 00000000000..4944e65c9f3
--- /dev/null
+++ b/mysql-test/suite/binlog/t/binlog_stm_row.test
@@ -0,0 +1,107 @@
+--source include/have_log_bin.inc
+--source include/have_binlog_format_row_or_statement.inc
+
+# Get rid of previous tests binlog
+--disable_query_log
+reset master;
+--enable_query_log
+
+#
+# Bug#34306: Can't make copy of log tables when server binary log is enabled
+#
+# This is an additional test for Bug#34306 in order to ensure that INSERT INTO
+# .. SELECT FROM is properly replicated under SBR and RBR and that the proper
+# read lock type are acquired.
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+SET GLOBAL BINLOG_FORMAT = STATEMENT;
+SET SESSION BINLOG_FORMAT = STATEMENT;
+
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 LIKE t1;
+select @@SESSION.BINLOG_FORMAT;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(2);
+
+--connect(con1,localhost,root,,)
+--connect(con2,localhost,root,,)
+
+--echo #
+--echo # Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
+--echo # lock that will prevent the source table from being modified.
+--echo #
+
+--connection con1
+--echo # con1
+SELECT GET_LOCK('Bug#34306', 120);
+--connection con2
+--echo # con2
+PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--send EXECUTE stmt;
+--connection default
+--echo # default
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "User lock" AND
+ info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--source include/wait_condition.inc
+--send INSERT INTO t2 VALUES (3);
+--connection con1
+--echo # con1
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "Locked" and info = "INSERT INTO t2 VALUES (3)";
+--source include/wait_condition.inc
+SELECT RELEASE_LOCK('Bug#34306');
+--connection con2
+--echo # con2
+--reap
+SELECT RELEASE_LOCK('Bug#34306');
+--connection default
+--echo # default
+--reap
+
+--echo #
+--echo # Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
+--echo # not prevent the source table from being modified if under RBR.
+--echo #
+
+--connection con2
+--echo # con2
+SET SESSION BINLOG_FORMAT = ROW;
+--connection con1
+--echo # con1
+SELECT GET_LOCK('Bug#34306', 120);
+--connection con2
+--echo # con2
+--send EXECUTE stmt;
+--connection default
+--echo # default
+let $wait_condition=
+ SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
+ state = "User lock" AND
+ info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
+--source include/wait_condition.inc
+--connection con1
+--echo # con1
+INSERT INTO t2 VALUES (4);
+SELECT RELEASE_LOCK('Bug#34306');
+--connection con2
+--echo # con2
+--reap
+
+--disconnect con1
+--disconnect con2
+--connection default
+--echo # default
+
+--echo # Show binlog events
+source include/show_binlog_events.inc;
+
+DROP TABLE t1;
+DROP TABLE t2;