PostgreSQL Source Code
git master
isolationtester.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* isolationtester.h
4
* include file for isolation tests
5
*
6
* Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7
* Portions Copyright (c) 1994, Regents of the University of California
8
*
9
* IDENTIFICATION
10
* src/test/isolation/isolationtester.h
11
*
12
*-------------------------------------------------------------------------
13
*/
14
#ifndef ISOLATIONTESTER_H
15
#define ISOLATIONTESTER_H
16
17
/*
18
* The structs declared here are used in the output of specparse.y.
19
* Except where noted, all fields are set in the grammar and not
20
* changed thereafter.
21
*/
22
typedef
struct
Step
Step
;
23
24
typedef
struct
25
{
26
char
*
name
;
27
char
*
setupsql
;
28
char
*
teardownsql
;
29
Step
**
steps
;
30
int
nsteps
;
31
}
Session
;
32
33
struct
Step
34
{
35
char
*
name
;
36
char
*
sql
;
37
/* These fields are filled by check_testspec(): */
38
int
session
;
/* identifies owning session */
39
bool
used
;
/* has step been used in a permutation? */
40
};
41
42
typedef
enum
43
{
44
PSB_ONCE
,
/* force step to wait once */
45
PSB_OTHER_STEP
,
/* wait for another step to complete first */
46
PSB_NUM_NOTICES
,
/* wait for N notices from another session */
47
}
PermutationStepBlockerType
;
48
49
typedef
struct
50
{
51
char
*
stepname
;
52
PermutationStepBlockerType
blocktype
;
53
int
num_notices
;
/* only used for PSB_NUM_NOTICES */
54
/* These fields are filled by check_testspec(): */
55
Step
*
step
;
/* link to referenced step (if any) */
56
/* These fields are runtime workspace: */
57
int
target_notices
;
/* total notices needed from other session */
58
}
PermutationStepBlocker
;
59
60
typedef
struct
61
{
62
char
*
name
;
/* name of referenced Step */
63
PermutationStepBlocker
**
blockers
;
64
int
nblockers
;
65
/* These fields are filled by check_testspec(): */
66
Step
*
step
;
/* link to referenced Step */
67
}
PermutationStep
;
68
69
typedef
struct
70
{
71
int
nsteps
;
72
PermutationStep
**
steps
;
73
}
Permutation
;
74
75
typedef
struct
76
{
77
char
**
setupsqls
;
78
int
nsetupsqls
;
79
char
*
teardownsql
;
80
Session
**
sessions
;
81
int
nsessions
;
82
Permutation
**
permutations
;
83
int
npermutations
;
84
}
TestSpec
;
85
86
extern
TestSpec
parseresult
;
87
88
extern
int
spec_yyparse
(
void
);
89
90
extern
int
spec_yylex
(
void
);
91
extern
void
spec_yyerror
(
const
char
*message);
92
93
#endif
/* ISOLATIONTESTER_H */
PermutationStepBlockerType
PermutationStepBlockerType
Definition:
isolationtester.h:43
PSB_NUM_NOTICES
@ PSB_NUM_NOTICES
Definition:
isolationtester.h:46
PSB_ONCE
@ PSB_ONCE
Definition:
isolationtester.h:44
PSB_OTHER_STEP
@ PSB_OTHER_STEP
Definition:
isolationtester.h:45
spec_yyerror
void spec_yyerror(const char *message)
parseresult
TestSpec parseresult
spec_yyparse
int spec_yyparse(void)
spec_yylex
int spec_yylex(void)
Session
struct Session Session
PermutationStepBlocker
Definition:
isolationtester.h:50
PermutationStepBlocker::stepname
char * stepname
Definition:
isolationtester.h:51
PermutationStepBlocker::blocktype
PermutationStepBlockerType blocktype
Definition:
isolationtester.h:52
PermutationStepBlocker::num_notices
int num_notices
Definition:
isolationtester.h:53
PermutationStepBlocker::step
Step * step
Definition:
isolationtester.h:55
PermutationStepBlocker::target_notices
int target_notices
Definition:
isolationtester.h:57
PermutationStep
Definition:
isolationtester.h:61
PermutationStep::step
Step * step
Definition:
isolationtester.h:66
PermutationStep::blockers
PermutationStepBlocker ** blockers
Definition:
isolationtester.h:63
PermutationStep::nblockers
int nblockers
Definition:
isolationtester.h:64
PermutationStep::name
char * name
Definition:
isolationtester.h:62
Permutation
Definition:
isolationtester.h:70
Permutation::nsteps
int nsteps
Definition:
isolationtester.h:71
Permutation::steps
PermutationStep ** steps
Definition:
isolationtester.h:72
Session
Definition:
session.h:26
Session::steps
Step ** steps
Definition:
isolationtester.h:29
Session::name
char * name
Definition:
isolationtester.h:26
Session::teardownsql
char * teardownsql
Definition:
isolationtester.h:28
Session::setupsql
char * setupsql
Definition:
isolationtester.h:27
Session::nsteps
int nsteps
Definition:
isolationtester.h:30
Step
Definition:
isolationtester.h:34
Step::name
char * name
Definition:
isolationtester.h:35
Step::session
int session
Definition:
isolationtester.h:38
Step::used
bool used
Definition:
isolationtester.h:39
Step::sql
char * sql
Definition:
isolationtester.h:36
TestSpec
Definition:
isolationtester.h:76
TestSpec::setupsqls
char ** setupsqls
Definition:
isolationtester.h:77
TestSpec::teardownsql
char * teardownsql
Definition:
isolationtester.h:79
TestSpec::sessions
Session ** sessions
Definition:
isolationtester.h:80
TestSpec::nsessions
int nsessions
Definition:
isolationtester.h:81
TestSpec::permutations
Permutation ** permutations
Definition:
isolationtester.h:82
TestSpec::nsetupsqls
int nsetupsqls
Definition:
isolationtester.h:78
TestSpec::npermutations
int npermutations
Definition:
isolationtester.h:83
src
test
isolation
isolationtester.h
Generated on Wed Nov 6 2024 06:13:26 for PostgreSQL Source Code by
1.9.1