From 19c380aaff1f1f3c0d21ac0c18904c21d7bdce76 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 3 Nov 2009 19:02:56 +0000 Subject: WL#2687 WL#5072 BUG#40278 BUG#47175 Non-transactional updates that take place inside a transaction present problems for logging because they are visible to other clients before the transaction is committed, and they are not rolled back even if the transaction is rolled back. It is not always possible to log correctly in statement format when both transactional and non-transactional tables are used in the same transaction. In the current patch, we ensure that such scenario is completely safe under the ROW and MIXED modes. --- mysql-test/r/commit_1innodb.result | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'mysql-test/r/commit_1innodb.result') diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index 51c4ac3002c..cf8c0e085c9 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); set sql_mode=no_engine_substitution; set storage_engine = InnoDB; set autocommit=1; @@ -578,11 +579,11 @@ SUCCESS select f1(); f1() 2 -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS commit; -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS # 17. Read-only statement, a function changes non-trans-table. @@ -595,11 +596,11 @@ select f1() from t1; f1() 2 2 -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS commit; -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS # 18. Read-write statement: UPDATE, change 0 (transactional) rows. @@ -627,7 +628,7 @@ SUCCESS drop table t2; set sql_mode=no_engine_substitution; create temporary table t2 (a int); -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS set sql_mode=default; @@ -708,11 +709,11 @@ SUCCESS # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction # drop temporary table t2; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS commit; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS # 26. Verify that SET AUTOCOMMIT issues an implicit commit @@ -829,11 +830,11 @@ create table if not exists t2 (a int) select 6 union select 7; Warnings: Note 1050 Table 't2' already exists # Sic: first commits the statement, and then the transaction. -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); SUCCESS create table t3 select a from t2; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); SUCCESS alter table t3 add column (b int); @@ -841,15 +842,15 @@ call p_verify_status_increment(2, 0, 2, 0); SUCCESS alter table t3 rename t4; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS rename table t4 to t3; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS truncate table t3; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS create view v1 as select * from t2; -- cgit v1.2.1