File: rr_sc_select-same_2.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (45 lines) | stat: -rw-r--r-- 1,972 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
################################################################################
#
# This test contains a single transaction performing queries against the test
# data. The main purpose is to test REPEATABLE READ results, that is to verify
# that reads (SELECTs) are indeed repeatable during a REPEATABLE READ 
# transaction. 
#
# Generally, queries which should yield the same results at one moment in time 
# should also yield the same results later in the same transaction. In some 
# configurations, however, phantom reads are allowed (may e.g. depend on 
# settings such as falcon_consistent_read).
#
# To detect missing rows, modified rows and possibly invalid (uncommitted) 
# extra (phantom) rows, we store query results in temporary tables and compare 
# using special queries. Using includes for this to avoid unnecessary "clutter"
# in each select-only test.
#
# This and similar tests (transactions) should contain some random "filler"
# between the SELECTs so that they may run in different conditions, such as:
#   * some other transactions may have commited in the meantime
#   * a scavenge run may have happened (falcon)
#   * etc
#
# Such a "random filler" can be:
#   * SLEEP()
#   * Bogus updates on some unrelated temporary table that was created for the purpose
#   * savepoint + bogus updates on the main tables + rollback to savepoint
#   * Inserts on new records (which will show up as "phantom" records in subsequent SELECTs) 
#
################################################################################

SET autocommit = 0;
START TRANSACTION;

# We do a full table scan in this test.
# Note: May cause deadlocks! (handled in sourced scripts).

let $query= SELECT * from t1;
--source suite/engines/rr_trx/include/record_query_all_columns.inc
SELECT SLEEP(1);
let $query= SELECT * from t1;
--source suite/engines/rr_trx/include/record_query_all_columns.inc
--source suite/engines/rr_trx/include/check_repeatable_read_all_columns.inc

COMMIT;