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-2025, 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 */
22typedef struct Step Step;
23
24typedef struct
25{
26 char *name;
27 char *setupsql;
30 int nsteps;
31} Session;
32
33struct 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
42typedef 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
49typedef 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
60typedef struct
61{
62 char *name; /* name of referenced Step */
65 /* These fields are filled by check_testspec(): */
66 Step *step; /* link to referenced Step */
68
69typedef struct
70{
71 int nsteps;
74
75typedef struct
76{
77 char **setupsqls;
84} TestSpec;
85
87
88extern int spec_yyparse(void);
89
90extern int spec_yylex(void);
91extern void spec_yyerror(const char *message);
92
93#endif /* ISOLATIONTESTER_H */
PermutationStepBlockerType
@ PSB_NUM_NOTICES
@ PSB_ONCE
@ PSB_OTHER_STEP
void spec_yyerror(const char *message)
Definition: specscanner.l:163
TestSpec parseresult
int spec_yyparse(void)
int spec_yylex(void)
struct Session Session
PermutationStepBlockerType blocktype
PermutationStepBlocker ** blockers
PermutationStep ** steps
Step ** steps
char * name
char * teardownsql
char * setupsql
char * name
int session
bool used
char * sql
char ** setupsqls
char * teardownsql
Session ** sessions
Permutation ** permutations
int npermutations