Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42bdaeb

Browse files
committed
Add a regression test for snapshot too old with hash indexes.
Amit Kapila, but I changed the comment not to be a copy-and-paste ofan existing one, and instead referred to it.Discussion:http://postgr.es/m/CAA4eK1K0UJswCRf81WwJFO4H=+ZvbmKTNhAps-NkdmHRsq1GnQ@mail.gmail.com
1 parentd8f356e commit42bdaeb

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

‎src/test/modules/snapshot_too_old/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# we have to clean those result files explicitly
55
EXTRA_CLEAN =$(pg_regress_clean_files)
66

7-
ISOLATIONCHECKS=sto_using_cursor sto_using_select
7+
ISOLATIONCHECKS=sto_using_cursor sto_using_select sto_using_hash_index
88

99
ifdefUSE_PGXS
1010
PG_CONFIG = pg_config
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This test is like sto_using_select, except that we test access via a
2+
# hash index.
3+
4+
setup
5+
{
6+
CREATETABLEsto1 (cintNOTNULL);
7+
INSERTINTOsto1SELECTgenerate_series(1,1000);
8+
CREATEINDEXidx_sto1ONsto1USINGHASH (c);
9+
}
10+
setup
11+
{
12+
VACUUMANALYZEsto1;
13+
}
14+
15+
teardown
16+
{
17+
DROPTABLEsto1;
18+
}
19+
20+
session"s1"
21+
setup{BEGINISOLATIONLEVELREPEATABLEREAD; }
22+
step"noseq"{SETenable_seqscan=false; }
23+
step"s1f1"{SELECTcFROMsto1wherec=1000; }
24+
step"s1f2"{SELECTcFROMsto1wherec=1001; }
25+
teardown{ROLLBACK; }
26+
27+
session"s2"
28+
step"s2sleep"{SELECTsetting,pg_sleep(6)FROMpg_settingsWHEREname='old_snapshot_threshold'; }
29+
step"s2u"{UPDATEsto1SETc=1001WHEREc=1000; }
30+
31+
permutation"noseq""s1f1""s2sleep""s2u""s1f2"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp