From 5753307aefaf378db280fd53e2e58fa7ce3d2295 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 12 Dec 2008 14:52:20 +0200 Subject: Bug #41383 Test commit1_innodb fails with binlog-format=row The test explicitly warned on existence of a bug in its 27th part. The expected values of prepare and commit counters changed, corrected, by fixes to bug#40221. Notice, that binlog does not have to register for a statement with the statement binlog-format because the statement rollback does not need to do anything in that mode. It's not so with the ROW format which was bug#40221 concern. Fixed with correcting the expected values of the mentioned counters and explained that with comments in the test. mysql-test/include/commit.inc: Removing `Sic' that warned on a bug (The one is bug#40221). Correcting the expected values of prepare and commit counters due to fixes to bug#40221. mysql-test/r/commit_1innodb.result: results changed. --- mysql-test/include/commit.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mysql-test/include/commit.inc') diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index 98f9c93b25a..48b0eac12e5 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -671,8 +671,11 @@ call p_verify_status_increment(2, 2, 2, 2); savepoint a; call p_verify_status_increment(0, 0, 0, 0); insert t1 set a=4; ---echo # Sic: a bug. Binlog did not register itself this time. -call p_verify_status_increment(1, 0, 1, 0); +--echo # Binlog does not register itself this time for other than the 1st +--echo # statement of the transaction with MIXED/STATEMENT binlog_format. +--echo # It needs registering with the ROW format. Therefore 1,0,2,2 are +--echo # the correct arguments to this test after bug#40221 fixed. +call p_verify_status_increment(1, 0, 2, 2); release savepoint a; rollback; call p_verify_status_increment(0, 0, 0, 0); -- cgit v1.2.1 From 8dbb9c885d42fd03b997a507d10620c1a55fa44d Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Fri, 9 Jan 2009 08:20:32 -0200 Subject: Bug#37016: TRUNCATE TABLE removes some rows but not all The special TRUNCATE TABLE (DDL) transaction wasn't being properly rolled back if a error occurred during row by row deletion. The error can be caused by a foreign key restriction imposed by InnoDB SE and would cause the server to erroneously issue a implicit commit. The solution is to rollback the transaction if a truncation via row by row deletion fails, otherwise commit. All effects of a TRUNCATE ABLE operation are rolled back if a row by row deletion fails. mysql-test/include/commit.inc: Truncate always starts a transaction and commits at the end. The commit at the end increases the count by two, one is the storage engine commit and the other is the binary log. mysql-test/r/commit_1innodb.result: Update test case results. mysql-test/r/innodb_mysql.result: Update test case results. mysql-test/t/innodb_mysql.test: Add test case for Bug#37016 sql/sql_delete.cc: Move truncation using row by row deletion to its own function. If row by row deletion fails, rollback the transaction. Remove the meddling with disabling and enabling of autocommit as TRUNCATE transaction is now explicitly ended (committed or rolled back). --- mysql-test/include/commit.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mysql-test/include/commit.inc') diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index 48b0eac12e5..de5eca8b1f6 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -617,10 +617,10 @@ call p_verify_status_increment(0, 0, 0, 0); --echo --echo # No test because of Bug#8729 "rename table fails on temporary table" ---echo # 24. DDL: TRUNCATE TEMPORARY TABLE, does not start a transaction +--echo # 24. DDL: TRUNCATE TEMPORARY TABLE --echo truncate table t2; -call p_verify_status_increment(2, 0, 2, 0); +call p_verify_status_increment(4, 0, 4, 0); commit; --echo # There is nothing left to commit call p_verify_status_increment(0, 0, 0, 0); @@ -733,7 +733,7 @@ call p_verify_status_increment(1, 0, 1, 0); rename table t4 to t3; call p_verify_status_increment(1, 0, 1, 0); truncate table t3; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(4, 4, 2, 2); create view v1 as select * from t2; call p_verify_status_increment(1, 0, 1, 0); check table t1; -- cgit v1.2.1 From d1323f433d21e49717b3a91fe79ae64f359a9093 Mon Sep 17 00:00:00 2001 From: Davi Arnaut Date: Mon, 12 Jan 2009 10:48:33 -0200 Subject: Post-merge fix for bug 37016: Update test case for row-based logging. mysql-test/r/commit_1innodb.result: Increase commit count for row-based logging. --- mysql-test/include/commit.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/include/commit.inc') diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index de5eca8b1f6..beae927764f 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -733,7 +733,7 @@ call p_verify_status_increment(1, 0, 1, 0); rename table t4 to t3; call p_verify_status_increment(1, 0, 1, 0); truncate table t3; -call p_verify_status_increment(4, 4, 2, 2); +call p_verify_status_increment(4, 4, 4, 4); create view v1 as select * from t2; call p_verify_status_increment(1, 0, 1, 0); check table t1; -- cgit v1.2.1