File: rr_sc_select-same_2.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (45 lines) | stat: -rw-r--r-- 1,972 bytes parent folder | download | duplicates (19)
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;