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-2021, 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;
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 */
48 
49 typedef struct
50 {
51  char *stepname;
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 */
59 
60 typedef struct
61 {
62  char *name; /* name of referenced Step */
64  int nblockers;
65  /* These fields are filled by check_testspec(): */
66  Step *step; /* link to referenced Step */
68 
69 typedef struct
70 {
71  int nsteps;
73 } Permutation;
74 
75 typedef struct
76 {
77  char **setupsqls;
79  char *teardownsql;
81  int nsessions;
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 *str);
92 
93 #endif /* ISOLATIONTESTER_H */
int spec_yylex(void)
Session ** sessions
char ** setupsqls
bool used
struct Session Session
char * teardownsql
Permutation ** permutations
char * setupsql
char * name
int npermutations
char * name
char * teardownsql
PermutationStepBlocker ** blockers
void spec_yyerror(const char *str)
PermutationStepBlockerType
Step ** steps
char * sql
int session
TestSpec parseresult
PermutationStep ** steps
int spec_yyparse(void)
PermutationStepBlockerType blocktype