From c68620df48cd1b0e7f5f1cb5ff8b905a5d9c80a5 Mon Sep 17 00:00:00 2001 From: Kristian Nielsen Date: Sat, 4 Nov 2023 20:40:31 +0100 Subject: [PATCH] Fix random test failures in testcase perfschema.mdl_func The test case can get extra rows in its output from table performance_schema.table_handles, left there by an earlier test case (for example main.long_unique_delayed). So force a server restart at the beginning of the test. Signed-off-by: Kristian Nielsen --- mysql-test/suite/perfschema/r/mdl_func.result | 1 + mysql-test/suite/perfschema/t/mdl_func.test | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mysql-test/suite/perfschema/r/mdl_func.result b/mysql-test/suite/perfschema/r/mdl_func.result index 4887b15efa5..f3fc0d10a96 100644 --- a/mysql-test/suite/perfschema/r/mdl_func.result +++ b/mysql-test/suite/perfschema/r/mdl_func.result @@ -1,3 +1,4 @@ +# restart UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; UPDATE performance_schema.setup_instruments SET enabled = 'YES' WHERE name in ('wait/io/table/sql/handler', diff --git a/mysql-test/suite/perfschema/t/mdl_func.test b/mysql-test/suite/perfschema/t/mdl_func.test index c7f5585a5c2..209c2f112af 100644 --- a/mysql-test/suite/perfschema/t/mdl_func.test +++ b/mysql-test/suite/perfschema/t/mdl_func.test @@ -1,5 +1,11 @@ --source include/not_embedded.inc --source include/have_perfschema.inc +# This test needs a fresh restart. The table performance_schema.table_handles +# can otherwise contain extra rows left from previous testcases. +# For example the test case main.long_unique_delayed, which uses +# INSERT DELAYED, will leave extra rows in this table if run just before this +# test, causing .result diff failure. +--source include/restart_mysqld.inc UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';