1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Marko Mäkelä
2022-08-01 15:15:06 +03:00
parent 40c2460d8c
commit 6a3fbfdb2d
2 changed files with 4 additions and 42 deletions

View File

@ -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,,;

View File

@ -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';