66 elog(
ERROR,
"SPI_prepare failed for \"%s\"", query_string);
70 elog(
ERROR,
"failed to execute \"%s\"", query_string);
72 if (tupdesc->
natts != 2 ||
75 elog(
ERROR,
"test_predtest query must yield two boolean columns");
106 if (
c2 ==
't' &&
c1 !=
't')
109 if (
c2 !=
'f' &&
c1 ==
'f')
112 if (
c2 ==
't' &&
c1 !=
'f')
115 if (
c2 ==
't' &&
c1 ==
't')
133 elog(
WARNING,
"s_r_holds was true; w_r_holds must not be false");
142 elog(
ERROR,
"test_predtest query string must contain exactly one query");
145 elog(
ERROR,
"test_predtest query must be a SELECT");
188 elog(
WARNING,
"strong_implied_by result is incorrect");
190 elog(
WARNING,
"weak_implied_by result is incorrect");
192 elog(
WARNING,
"strong_refuted_by result is incorrect");
194 elog(
WARNING,
"weak_refuted_by result is incorrect");
207 elog(
WARNING,
"strong_refuted_by was proven; weak_refuted_by should also be proven");
217 "strong_implied_by",
BOOLOID, -1, 0);
219 "weak_implied_by",
BOOLOID, -1, 0);
221 "strong_refuted_by",
BOOLOID, -1, 0);
223 "weak_refuted_by",
BOOLOID, -1, 0);
static Datum values[MAXATTR]
#define Assert(condition)
TupleDesc BlessTupleDesc(TupleDesc tupdesc)
#define PG_GETARG_TEXT_PP(n)
#define PG_FUNCTION_INFO_V1(funcname)
#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, const Oid *argtypes)
Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
Datum test_predtest(PG_FUNCTION_ARGS)
TupleDesc CreateTemplateTupleDesc(int natts)
void TupleDescFinalize(TupleDesc tupdesc)
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)