File tree 3 files changed +47
-1
lines changed
src/test/modules/snapshot_too_old
3 files changed +47
-1
lines changed Original file line number Diff line number Diff line change 4
4
# we have to clean those result files explicitly
5
5
EXTRA_CLEAN = $(pg_regress_clean_files )
6
6
7
- ISOLATIONCHECKS =sto_using_cursor sto_using_select
7
+ ISOLATIONCHECKS =sto_using_cursor sto_using_select sto_using_hash_index
8
8
9
9
ifdef USE_PGXS
10
10
PG_CONFIG = pg_config
Original file line number Diff line number Diff line change
1
+ Parsed test spec with 2 sessions
2
+
3
+ starting permutation: noseq s1f1 s2sleep s2u s1f2
4
+ step noseq: SET enable_seqscan = false;
5
+ step s1f1: SELECT c FROM sto1 where c = 1000;
6
+ c
7
+
8
+ 1000
9
+ step s2sleep: SELECT setting, pg_sleep(6) FROM pg_settings WHERE name = 'old_snapshot_threshold';
10
+ setting pg_sleep
11
+
12
+ 0
13
+ step s2u: UPDATE sto1 SET c = 1001 WHERE c = 1000;
14
+ step s1f2: SELECT c FROM sto1 where c = 1001;
15
+ ERROR: snapshot too old
Original file line number Diff line number Diff line change
1
+ # This test is like sto_using_select, except that we test access via a
2
+ # hash index.
3
+
4
+ setup
5
+ {
6
+ CREATE TABLE sto1 (c int NOT NULL );
7
+ INSERT INTO sto1 SELECT generate_series (1 , 1000 );
8
+ CREATE INDEX idx_sto1 ON sto1 USING HASH (c );
9
+ }
10
+ setup
11
+ {
12
+ VACUUM ANALYZE sto1 ;
13
+ }
14
+
15
+ teardown
16
+ {
17
+ DROP TABLE sto1 ;
18
+ }
19
+
20
+ session "s1"
21
+ setup { BEGIN ISOLATION LEVEL REPEATABLE READ ; }
22
+ step "noseq" { SET enable_seqscan = false ; }
23
+ step "s1f1" { SELECT c FROM sto1 where c = 1000 ; }
24
+ step "s1f2" { SELECT c FROM sto1 where c = 1001 ; }
25
+ teardown { ROLLBACK ; }
26
+
27
+ session "s2"
28
+ step "s2sleep" { SELECT setting , pg_sleep (6 ) FROM pg_settings WHERE name = 'old_snapshot_threshold' ; }
29
+ step "s2u" { UPDATE sto1 SET c = 1001 WHERE c = 1000 ; }
30
+
31
+ permutation "noseq" "s1f1" "s2sleep" "s2u" "s1f2"
You can’t perform that action at this time.
0 commit comments