From c33c638f39eb626ca7e77cbdd38eef6aee53f25e Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 21 Dec 2016 22:40:52 +0200 Subject: [PATCH] MDEV-7558 analyze_stmt_slow_query_log fails sporadically in buildbot The reason was that the test was reusing the same log file without deleting it between tests. Fixed by creating a new log file as part of the test --- mysql-test/r/analyze_stmt_slow_query_log.result | 3 +++ mysql-test/t/analyze_stmt_slow_query_log.test | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/mysql-test/r/analyze_stmt_slow_query_log.result b/mysql-test/r/analyze_stmt_slow_query_log.result index 7d280e66b6c..a0c4b45dee0 100644 --- a/mysql-test/r/analyze_stmt_slow_query_log.result +++ b/mysql-test/r/analyze_stmt_slow_query_log.result @@ -1,4 +1,7 @@ drop table if exists t1; +SET @@global.slow_query_log = OFF; +FLUSH SLOW LOGS; +SET @@global.slow_query_log = ON; create table t1 (a int); INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); select * from t1 where a<3; diff --git a/mysql-test/t/analyze_stmt_slow_query_log.test b/mysql-test/t/analyze_stmt_slow_query_log.test index 7346ac3b2c5..44865b652cb 100644 --- a/mysql-test/t/analyze_stmt_slow_query_log.test +++ b/mysql-test/t/analyze_stmt_slow_query_log.test @@ -2,6 +2,21 @@ drop table if exists t1; --enable_warnings +# +# Remove old log file +# +let SLOW_LOG_FILE= `select @@slow_query_log_file`; + +SET @@global.slow_query_log = OFF; + +perl; + my $slow_log_file= $ENV{'SLOW_LOG_FILE'} or die "SLOW_LOG_FILE not set"; + unlink($slow_log_file); +EOF + +FLUSH SLOW LOGS; +SET @@global.slow_query_log = ON; + create table t1 (a int); INSERT INTO t1 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); select * from t1 where a<3;