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

Commit418ec32

Browse files
committed
Add a regression test for contrib/tcn.
Just whittling down the list of contrib modules with zero coverage.Discussion:https://postgr.es/m/909667.1659222591@sss.pgh.pa.us
1 parentb592422 commit418ec32

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

‎contrib/tcn/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated subdirectories
2+
/log/
3+
/results/
4+
/output_iso/
5+
/tmp_check/
6+
/tmp_check_iso/

‎contrib/tcn/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ EXTENSION = tcn
66
DATA = tcn--1.0.sql
77
PGFILEDESC = "tcn - trigger function notifying listeners"
88

9+
ISOLATION = tcn
10+
911
ifdefUSE_PGXS
1012
PG_CONFIG = pg_config
1113
PGXS :=$(shell$(PG_CONFIG) --pgxs)

‎contrib/tcn/expected/tcn.out

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Parsed test spec with 1 sessions
2+
3+
starting permutation: listen insert insert2 update delete
4+
step listen: LISTEN mychannel;
5+
step insert: INSERT INTO mytable VALUES(1, 'one');
6+
s1: NOTIFY "mychannel" with payload ""mytable",I,"key"='1'" from s1
7+
step insert2: INSERT INTO mytable VALUES(2, 'two');
8+
s1: NOTIFY "mychannel" with payload ""mytable",I,"key"='2'" from s1
9+
step update: UPDATE mytable SET value = 'foo' WHERE key = 2;
10+
s1: NOTIFY "mychannel" with payload ""mytable",U,"key"='2'" from s1
11+
step delete: DELETE FROM mytable;
12+
s1: NOTIFY "mychannel" with payload ""mytable",D,"key"='1'" from s1
13+
s1: NOTIFY "mychannel" with payload ""mytable",D,"key"='2'" from s1

‎contrib/tcn/specs/tcn.spec

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Tests for contrib/tcn
2+
3+
# These tests use only self-notifies within a single session,
4+
# which are convenient because they minimize timing concerns.
5+
# Whether the NOTIFY mechanism works across sessions is not
6+
# really tcn's problem.
7+
8+
setup
9+
{
10+
CREATEEXTENSIONtcn;
11+
CREATETABLEmytable (keyintPRIMARYKEY,valuetext);
12+
CREATETRIGGERtcntrigAFTERINSERTORUPDATEORDELETEONmytable
13+
FOREACHROWEXECUTEFUNCTIONtriggered_change_notification(mychannel);
14+
}
15+
16+
teardown
17+
{
18+
DROPTABLEmytable;
19+
}
20+
21+
sessions1
22+
steplisten{LISTENmychannel; }
23+
stepinsert{INSERTINTOmytableVALUES(1,'one'); }
24+
stepinsert2{INSERTINTOmytableVALUES(2,'two'); }
25+
stepupdate{UPDATEmytableSETvalue='foo'WHEREkey=2; }
26+
stepdelete{DELETEFROMmytable; }
27+
28+
29+
permutationlisteninsertinsert2updatedelete

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp