From 57ae28ab95fb3fede2ae191daca8eb21541230c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Apr 2008 10:28:19 -0300 Subject: [PATCH] Bug#35788 A few tests fail due to concurrent inserts The problem is that since MyISAM's concurrent_insert is on by default some concurrent SELECT statements might not see changes made by INSERT statements in other connections, even if the INSERT statement has returned. The solution is to disable concurrent_insert so that INSERT statements returns after the data is actually visible to other statements. mysql-test/r/client_xml.result: Update test case result. mysql-test/r/federated.result: Update test case result. mysql-test/r/federated_bug_25714.result: Update test case result. mysql-test/t/client_xml.test: Disable concurrent insert and restore old value at the end of the test so it doesn't affect other tests. mysql-test/t/federated.test: Disable concurrent insert and restore old value at the end of the test so it doesn't affect other tests. mysql-test/t/federated_bug_25714.test: Disable concurrent insert and restore old value at the end of the test so it doesn't affect other tests. --- mysql-test/r/client_xml.result | 3 +++ mysql-test/r/federated.result | 3 +++ mysql-test/r/federated_bug_25714.result | 3 +++ mysql-test/t/client_xml.test | 9 +++++++++ mysql-test/t/federated.test | 12 ++++++++++++ mysql-test/t/federated_bug_25714.test | 11 ++++++++++- 6 files changed, 40 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/client_xml.result b/mysql-test/r/client_xml.result index ed5e8f2c1b8..6e9857c2d6d 100644 --- a/mysql-test/r/client_xml.result +++ b/mysql-test/r/client_xml.result @@ -1,3 +1,5 @@ +set @old_concurrent_insert= @@global.concurrent_insert; +set @@global.concurrent_insert= 0; create table t1 ( `a&b` int, `ab'); --exec $MYSQL --xml test -vv -e "select 1 limit 0" drop table t1; + +# Restore global concurrent_insert value +set @@global.concurrent_insert= @old_concurrent_insert; diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index 907c7e722ac..69a2d3187db 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -2,6 +2,14 @@ --source include/not_embedded.inc --source include/federated.inc +connection default; + +# Disable concurrent inserts to avoid test failures when reading +# data from concurrent connections (insert might return before +# the data is actually in the table). +SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; + connection slave; DROP TABLE IF EXISTS federated.t1; CREATE TABLE federated.t1 ( @@ -1857,3 +1865,7 @@ drop server 's1'; --echo End of 5.1 tests source include/federated_cleanup.inc; + +connection default; + +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT; diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/t/federated_bug_25714.test index 9c185181511..26ff143135a 100644 --- a/mysql-test/t/federated_bug_25714.test +++ b/mysql-test/t/federated_bug_25714.test @@ -1,6 +1,13 @@ --source include/have_bug25714.inc source include/federated.inc; +connection default; + +# Disable concurrent inserts to avoid test failures when reading +# data from concurrent connections (insert might return before +# the data is actually in the table). +SET @OLD_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; connection slave; --disable_warnings @@ -42,6 +49,8 @@ DROP TABLE federated.t1; connection slave; DROP TABLE federated.t1; - source include/federated_cleanup.inc; +connection default; + +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;