From 8399eb769e4da215d0715e06bbb610cf985ef54d Mon Sep 17 00:00:00 2001 From: Matthias Leich Date: Thu, 2 Oct 2008 13:04:29 +0200 Subject: [PATCH] Fix for Bug#38762 main.federated_bug_25714 fails sporadically --- mysql-test/r/federated_bug_25714.result | 6 ++++++ mysql-test/t/federated_bug_25714.test | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/mysql-test/r/federated_bug_25714.result b/mysql-test/r/federated_bug_25714.result index 12554f7af3a..5730eedc246 100644 --- a/mysql-test/r/federated_bug_25714.result +++ b/mysql-test/r/federated_bug_25714.result @@ -9,6 +9,10 @@ DROP DATABASE IF EXISTS federated; CREATE DATABASE federated; DROP DATABASE IF EXISTS federated; CREATE DATABASE federated; +SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; +SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; DROP TABLE IF EXISTS federated.bug_13118_table; CREATE TABLE federated.t1 ( `id` int auto_increment primary key, @@ -49,7 +53,9 @@ id value 7 54 8 55 DROP TABLE federated.t1; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT; DROP TABLE federated.t1; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/federated_bug_25714.test b/mysql-test/t/federated_bug_25714.test index 9c185181511..6d112cae5b8 100644 --- a/mysql-test/t/federated_bug_25714.test +++ b/mysql-test/t/federated_bug_25714.test @@ -1,8 +1,16 @@ --source include/have_bug25714.inc source include/federated.inc; +connection master; +# 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_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; connection slave; +SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT; +SET @@GLOBAL.CONCURRENT_INSERT= 0; --disable_warnings DROP TABLE IF EXISTS federated.bug_13118_table; --enable_warnings @@ -39,9 +47,12 @@ SELECT LAST_INSERT_ID(); SELECT * from federated.t1; DROP TABLE federated.t1; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT; connection slave; DROP TABLE federated.t1; +SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT; source include/federated_cleanup.inc; +