Definition at line 32 of file test_predtest.c.
33{
53 bool nulls[8] = {0};
55
56
58
59
60
61
62
63
64
67 elog(
ERROR,
"SPI_prepare failed for \"%s\"", query_string);
68
71 elog(
ERROR,
"failed to execute \"%s\"", query_string);
73 if (tupdesc->
natts != 2 ||
76 elog(
ERROR,
"test_predtest query must yield two boolean columns");
77
80 {
83 bool isnull;
86
87
89 if (isnull)
93 else
95
97 if (isnull)
101 else
103
104
105
106
107 if (
c2 ==
't' &&
c1 !=
't')
109
110 if (
c2 !=
'f' &&
c1 ==
'f')
112
113 if (
c2 ==
't' &&
c1 !=
'f')
115
116 if (
c2 ==
't' &&
c1 ==
't')
118 }
119
120
121
122
123
124
125
126
127
128
129
130
131
132
134 elog(
WARNING,
"s_r_holds was true; w_r_holds must not be false");
135
136
137
138
139
141
143 elog(
ERROR,
"test_predtest query string must contain exactly one query");
146 elog(
ERROR,
"test_predtest query must be a SELECT");
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
168
171 false);
172
175 true);
176
179 false);
180
183 true);
184
185
186
187
189 elog(
WARNING,
"strong_implied_by result is incorrect");
191 elog(
WARNING,
"weak_implied_by result is incorrect");
193 elog(
WARNING,
"strong_refuted_by result is incorrect");
195 elog(
WARNING,
"weak_refuted_by result is incorrect");
196
197
198
199
200
201
202
203
204
205
206
208 elog(
WARNING,
"strong_refuted_by was proven; weak_refuted_by should also be proven");
209
210
211
212
215
218 "strong_implied_by",
BOOLOID, -1, 0);
220 "weak_implied_by",
BOOLOID, -1, 0);
222 "strong_refuted_by",
BOOLOID, -1, 0);
224 "weak_refuted_by",
BOOLOID, -1, 0);
234
243
245}
static Datum values[MAXATTR]
#define Assert(condition)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_DATUM(x)
static Datum HeapTupleGetDatum(const HeapTupleData *tuple)
HeapTuple heap_form_tuple(TupleDesc tupleDescriptor, const Datum *values, const bool *isnull)
List * make_ands_implicit(Expr *clause)
static int list_length(const List *l)
#define linitial_node(type, l)
#define lsecond_node(type, l)
static bool DatumGetBool(Datum X)
static Datum BoolGetDatum(bool X)
bool predicate_refuted_by(List *predicate_list, List *clause_list, bool weak)
bool predicate_implied_by(List *predicate_list, List *clause_list, bool weak)
SPITupleTable * SPI_tuptable
int SPI_execute_plan(SPIPlanPtr plan, const Datum *Values, const char *Nulls, bool read_only, long tcount)
CachedPlan * SPI_plan_get_cached_plan(SPIPlanPtr plan)
SPIPlanPtr SPI_prepare(const char *src, int nargs, Oid *argtypes)
Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescInitEntry(TupleDesc desc, AttrNumber attributeNumber, const char *attributeName, Oid oidtypeid, int32 typmod, int attdim)
static FormData_pg_attribute * TupleDescAttr(TupleDesc tupdesc, int i)
char * text_to_cstring(const text *t)
References Assert, BlessTupleDesc(), BoolGetDatum(), CMD_SELECT, CreateTemplateTupleDesc(), DatumGetBool(), elog, ERROR, fb(), heap_form_tuple(), HeapTupleGetDatum(), i, linitial_node, list_length(), lsecond_node, make_ands_implicit(), TupleDescData::natts, PG_GETARG_TEXT_PP, PG_RETURN_DATUM, plan, predicate_implied_by(), predicate_refuted_by(), SPI_connect(), SPI_execute_plan(), SPI_finish(), SPI_getbinval(), SPI_OK_FINISH, SPI_OK_SELECT, SPI_plan_get_cached_plan(), SPI_prepare(), SPI_processed, SPI_tuptable, stmt, CachedPlan::stmt_list, text_to_cstring(), SPITupleTable::tupdesc, TupleDescAttr(), TupleDescInitEntry(), SPITupleTable::vals, values, and WARNING.