diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2009-11-03 19:02:56 +0000 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2009-11-03 19:02:56 +0000 |
commit | 19c380aaff1f1f3c0d21ac0c18904c21d7bdce76 (patch) | |
tree | 0e262b0d25432c224e2d4c8e1a1d608f78444771 /mysql-test/include/commit.inc | |
parent | 97565b8d1ab24b6f861300c75a4f4f3c7d711be6 (diff) | |
download | mariadb-git-19c380aaff1f1f3c0d21ac0c18904c21d7bdce76.tar.gz |
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.
Diffstat (limited to 'mysql-test/include/commit.inc')
-rw-r--r-- | mysql-test/include/commit.inc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index d91ba8291fd..4336d3be0ed 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -547,9 +547,9 @@ call p_verify_status_increment(0, 0, 0, 0); --echo # the binary log. --echo # select f1(); -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); commit; -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); --echo # 17. Read-only statement, a function changes non-trans-table. --echo # @@ -557,15 +557,19 @@ call p_verify_status_increment(0, 0, 1, 0); --echo # non-transactional changes saved in the transaction cache to --echo # the binary log. --echo # +--disable_warnings select f1() from t1; -call p_verify_status_increment(1, 0, 2, 0); +--enable_warnings +call p_verify_status_increment(2, 0, 2, 0); commit; -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); --echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows. --echo # select count(*) from t2; +--disable_warnings update t1 set a=2 where a=f1()+10; +--enable_warnings select count(*) from t2; call p_verify_status_increment(2, 0, 2, 0); commit; @@ -579,7 +583,7 @@ call p_verify_status_increment(2, 0, 2, 0); 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); set sql_mode=default; --echo # 19. A function changes temp-trans-table. --echo # @@ -636,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0); --echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction --echo # drop temporary table t2; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); commit; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); --echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit --echo # @@ -719,17 +723,17 @@ call p_verify_status_increment(4, 4, 4, 4); --echo # Sic: no table is created. create table if not exists t2 (a int) select 6 union select 7; --echo # 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); 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); alter table t3 add column (b int); call p_verify_status_increment(2, 0, 2, 0); alter table t3 rename t4; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); rename table t4 to t3; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); truncate table t3; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); create view v1 as select * from t2; call p_verify_status_increment(1, 0, 1, 0); check table t1; |