Skip to content

Commit

Permalink
Tests: commit counters for TRT [#305, #302]
Browse files Browse the repository at this point in the history
Tests affected: main.commit_1innodb
  • Loading branch information
midenok committed Nov 16, 2017
1 parent 0ccf126 commit 5d88b4a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
32 changes: 16 additions & 16 deletions mysql-test/include/commit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,14 @@ call p_verify_status_increment(1, 0, 1, 0);
insert into t1 (a) values (1);
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
--echo # 3. Read-write statement: UPDATE, update 1 row.
--echo #
update t1 set a=2;
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
--echo # 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE
--echo #
Expand Down Expand Up @@ -460,7 +460,7 @@ call p_verify_status_increment(2, 0, 1, 0);
delete from t1 where a=2;
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);

--echo # 8. Read-write statement: unqualified DELETE
--echo #
Expand All @@ -474,21 +474,21 @@ call p_verify_status_increment(2, 2, 2, 2);
delete from t1;
call p_verify_status_increment(2, 2, 1, 0);
commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);

--echo # 9. Read-write statement: REPLACE, change 1 row.
--echo #
replace t1 set a=1;
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);

--echo # 10. Read-write statement: REPLACE, change 0 rows.
--echo #
replace t1 set a=1;
call p_verify_status_increment(2, 2, 1, 0);
commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);

--echo # 11. Read-write statement: IODKU, change 1 row.
--echo #
Expand All @@ -497,28 +497,28 @@ call p_verify_status_increment(2, 2, 2, 2);
select * from t1;
call p_verify_status_increment(1, 0, 1, 0);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);

--echo # 12. Read-write statement: IODKU, change 0 rows.
--echo #
insert t1 set a=2 on duplicate key update a=2;
call p_verify_status_increment(2, 2, 1, 0);
commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);

--echo # 13. Read-write statement: INSERT IGNORE, change 0 rows.
--echo #
insert ignore t1 set a=2;
call p_verify_status_increment(2, 2, 1, 0);
commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);

--echo # 14. Read-write statement: INSERT IGNORE, change 1 row.
--echo #
insert ignore t1 set a=1;
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
--echo # 15. Read-write statement: UPDATE IGNORE, change 0 rows.
--echo #
--disable_warnings
Expand Down Expand Up @@ -675,7 +675,7 @@ call p_verify_status_increment(1, 0, 1, 0);
insert t1 set a=3;
call p_verify_status_increment(2, 2, 2, 2);
set autocommit=1;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
rollback;
select a from t1 where a=3;
call p_verify_status_increment(1, 0, 1, 0);
Expand Down Expand Up @@ -717,13 +717,13 @@ call p_verify_status_increment(0, 0, 0, 0);
do (select f1() from t1 where a=2);
call p_verify_status_increment(2, 2, 2, 2);
commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);

--echo # 29. Read-write statement: MULTI-DELETE
--echo #
delete t1, t2 from t1 join t2 on (t1.a=t2.a) where t1.a=2;
commit;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(5, 4, 5, 4);

--echo # 30. Read-write statement: INSERT-SELECT, MULTI-UPDATE, REPLACE-SELECT
--echo #
Expand All @@ -733,7 +733,7 @@ commit;
replace into t2 select a from t1;
--enable_warnings
commit;
call p_verify_status_increment(8, 8, 8, 8);
call p_verify_status_increment(10, 8, 10, 8);
#
# Multi-update is one of the few remaining statements that still
# locks the tables at prepare step (and hence starts the transaction.
Expand All @@ -744,7 +744,7 @@ call p_verify_status_increment(8, 8, 8, 8);
update t1, t2 set t1.a=4, t2.a=8 where t1.a=t2.a and t1.a=1;
--enable_ps_protocol
commit;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(5, 4, 5, 4);

--echo # 31. DDL: various DDL with transactional tables
--echo #
Expand All @@ -755,7 +755,7 @@ call p_verify_status_increment(0, 0, 0, 0);
create table t3 select a from t2;
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);
call p_verify_status_increment(3, 0, 3, 0);
alter table t3 rename t4;
call p_verify_status_increment(0, 0, 0, 0);
rename table t4 to t3;
Expand Down
32 changes: 16 additions & 16 deletions mysql-test/r/commit_1innodb.result
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 3. Read-write statement: UPDATE, update 1 row.
Expand All @@ -414,7 +414,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 4. Read-write statement: UPDATE, update 0 rows, 1 row matches WHERE
Expand Down Expand Up @@ -461,7 +461,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 8. Read-write statement: unqualified DELETE
Expand All @@ -478,7 +478,7 @@ call p_verify_status_increment(2, 2, 1, 0);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);
SUCCESS

# 9. Read-write statement: REPLACE, change 1 row.
Expand All @@ -488,7 +488,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 10. Read-write statement: REPLACE, change 0 rows.
Expand All @@ -498,7 +498,7 @@ call p_verify_status_increment(2, 2, 1, 0);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);
SUCCESS

# 11. Read-write statement: IODKU, change 1 row.
Expand All @@ -514,7 +514,7 @@ call p_verify_status_increment(1, 0, 1, 0);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 12. Read-write statement: IODKU, change 0 rows.
Expand All @@ -524,7 +524,7 @@ call p_verify_status_increment(2, 2, 1, 0);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);
SUCCESS

# 13. Read-write statement: INSERT IGNORE, change 0 rows.
Expand All @@ -536,7 +536,7 @@ call p_verify_status_increment(2, 2, 1, 0);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 1, 0);
call p_verify_status_increment(3, 2, 2, 0);
SUCCESS

# 14. Read-write statement: INSERT IGNORE, change 1 row.
Expand All @@ -546,7 +546,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 15. Read-write statement: UPDATE IGNORE, change 0 rows.
Expand Down Expand Up @@ -724,7 +724,7 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

set autocommit=1;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

rollback;
Expand Down Expand Up @@ -800,14 +800,14 @@ call p_verify_status_increment(2, 2, 2, 2);
SUCCESS

commit;
call p_verify_status_increment(2, 2, 2, 2);
call p_verify_status_increment(3, 2, 3, 2);
SUCCESS

# 29. Read-write statement: MULTI-DELETE
#
delete t1, t2 from t1 join t2 on (t1.a=t2.a) where t1.a=2;
commit;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(5, 4, 5, 4);
SUCCESS

# 30. Read-write statement: INSERT-SELECT, MULTI-UPDATE, REPLACE-SELECT
Expand All @@ -816,12 +816,12 @@ insert into t2 select a from t1;
commit;
replace into t2 select a from t1;
commit;
call p_verify_status_increment(8, 8, 8, 8);
call p_verify_status_increment(10, 8, 10, 8);
SUCCESS

update t1, t2 set t1.a=4, t2.a=8 where t1.a=t2.a and t1.a=1;
commit;
call p_verify_status_increment(4, 4, 4, 4);
call p_verify_status_increment(5, 4, 5, 4);
SUCCESS

# 31. DDL: various DDL with transactional tables
Expand All @@ -839,7 +839,7 @@ call p_verify_status_increment(2, 0, 4, 4);
SUCCESS

alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0);
call p_verify_status_increment(3, 0, 3, 0);
SUCCESS

alter table t3 rename t4;
Expand Down

0 comments on commit 5d88b4a

Please sign in to comment.