From 6a3fbfdb2d048a0a1b5762f8a56df35ba6986cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 1 Aug 2022 15:15:06 +0300 Subject: [PATCH] MDEV-14804 innodb.update_time occasionally fails Let simplify the test. The update_time is stored in the table metadata (dict_table_t); it has nothing to do with buffer pool page eviction or replacement. --- mysql-test/suite/innodb/r/update_time.result | 19 ++------------ mysql-test/suite/innodb/t/update_time.test | 27 ++------------------ 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/mysql-test/suite/innodb/r/update_time.result b/mysql-test/suite/innodb/r/update_time.result index 96d1af4c09c..6014ad4c7b0 100644 --- a/mysql-test/suite/innodb/r/update_time.result +++ b/mysql-test/suite/innodb/r/update_time.result @@ -2,7 +2,7 @@ # Test that INFORMATION_SCHEMA.TABLES.UPDATE_TIME is filled # correctly for InnoDB tables. # -CREATE TABLE t (a INT) ENGINE=INNODB; +CREATE TABLE t (a INT) ENGINE=INNODB STATS_PERSISTENT=0; SELECT update_time FROM information_schema.tables WHERE table_name = 't'; update_time NULL @@ -19,24 +19,9 @@ SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't' AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120; COUNT(*) 1 -CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB; -SELECT COUNT(*) FROM information_schema.innodb_buffer_page -WHERE table_name = '`test`.`t`'; -COUNT(*) -1 -INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240; -SELECT COUNT(*) FROM information_schema.innodb_buffer_page -WHERE table_name = '`test`.`t`'; -COUNT(*) -0 -SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't' -AND update_time IS NOT NULL; -COUNT(*) -1 -DROP TEMPORARY TABLE big; # Test the behavior after restart with a prepared XA transaction XA START 'xatrx'; -INSERT INTO t VALUES (5); +DELETE FROM t; XA END 'xatrx'; XA PREPARE 'xatrx'; CONNECT con1,localhost,root,,; diff --git a/mysql-test/suite/innodb/t/update_time.test b/mysql-test/suite/innodb/t/update_time.test index fd1e082f5f2..ce8418904c9 100644 --- a/mysql-test/suite/innodb/t/update_time.test +++ b/mysql-test/suite/innodb/t/update_time.test @@ -5,14 +5,10 @@ -- echo # -- source include/have_innodb.inc --- source include/have_innodb_max_16k.inc # restart does not work with embedded -- source include/not_embedded.inc -# This test is slow on buildbot. ---source include/big_test.inc ---source include/have_sequence.inc -CREATE TABLE t (a INT) ENGINE=INNODB; +CREATE TABLE t (a INT) ENGINE=INNODB STATS_PERSISTENT=0; SELECT update_time FROM information_schema.tables WHERE table_name = 't'; @@ -28,29 +24,10 @@ AND update_time IS NOT NULL; SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't' AND TIMESTAMPDIFF(SECOND, update_time, NOW()) < 120; -CREATE TEMPORARY TABLE big (a TEXT) ENGINE=INNODB; - -SELECT COUNT(*) FROM information_schema.innodb_buffer_page -WHERE table_name = '`test`.`t`'; - -# evict table 't' by inserting as much data as the BP size itself -INSERT INTO big SELECT REPEAT('a', 1024) FROM seq_1_to_10240; - -# confirm that all pages for table 't' have been evicted -SELECT COUNT(*) FROM information_schema.innodb_buffer_page -WHERE table_name = '`test`.`t`'; - -# The result from this query will change once update_time becomes persistent -# (WL#6917). -SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 't' -AND update_time IS NOT NULL; - -DROP TEMPORARY TABLE big; - -- echo # Test the behavior after restart with a prepared XA transaction XA START 'xatrx'; -INSERT INTO t VALUES (5); +DELETE FROM t; XA END 'xatrx'; XA PREPARE 'xatrx';