diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/engines/rr_trx/check_consistency.sql | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.tar.xz mariadb-10.5-a175314c3e5827eb193872241446f2f8f5c9d33c.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/engines/rr_trx/check_consistency.sql')
-rw-r--r-- | mysql-test/suite/engines/rr_trx/check_consistency.sql | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mysql-test/suite/engines/rr_trx/check_consistency.sql b/mysql-test/suite/engines/rr_trx/check_consistency.sql new file mode 100644 index 00000000..2f88e87c --- /dev/null +++ b/mysql-test/suite/engines/rr_trx/check_consistency.sql @@ -0,0 +1,31 @@ +USE test; +-- This file contains queries that can be used to check table consistency after running the stress_tx_rr test suite. +-- Contains a mix of queries used throughout the actual test suite. +-- When server is running, run this script e.g. like this: +-- ./bin/mysql -v -u root -h 127.0.0.1 < mysql-test/suite/engines/rr_trx/check_consistency.sql + +CHECK TABLE t1; +ANALYZE TABLE t1; + +-- Sum of all integers that are part of the test data should be 0 +SELECT SUM(`int1` + `int1_key` + `int1_unique` + + `int2` + `int2_key` + `int2_unique`) + AS TotalSum + FROM t1; + +-- No uncommitted data should be visible to a REPEATABLE-READ transaction +SELECT * FROM t1 WHERE `is_uncommitted` = 1; + +-- No rows marked as consistent should have row-sum not equal to 0 +SELECT * FROM t1 WHERE @sum:=`int1` + `int1_key` + `int1_unique` + `int2` + `int2_key` + `int2_unique` <> 0 AND `is_consistent` = 1; + +-- Check the table count. SHOULD NOT BE 0. +SELECT COUNT(*) FROM t1; + +-- The count of rows with pk divisible by 5 should be constant. +-- (less useful when there is no concurrency, though) +SELECT COUNT(*) FROM t1 WHERE `pk` MOD 5 = 0 AND `pk` BETWEEN 1 AND 1000; + +-- Check statistics (any number is OK, we are only looking for an impractical amount of errors +SELECT * FROM statistics; + |