if (tupdesc->natts != 2 ||
TupleDescAttr(tupdesc, 0)->atttypid != BOOLOID ||
TupleDescAttr(tupdesc, 1)->atttypid != BOOLOID)
- elog(ERROR, "query must yield two boolean columns");
+ elog(ERROR, "test_predtest query must yield two boolean columns");
s_i_holds = w_i_holds = s_r_holds = w_r_holds = true;
for (i = 0; i < SPI_processed; i++)
*/
cplan = SPI_plan_get_cached_plan(spiplan);
- if (list_length(cplan->stmt_list) != 1)
- elog(ERROR, "failed to decipher query plan");
+ if (cplan == NULL || list_length(cplan->stmt_list) != 1)
+ elog(ERROR, "test_predtest query string must contain exactly one query");
stmt = linitial_node(PlannedStmt, cplan->stmt_list);
if (stmt->commandType != CMD_SELECT)
- elog(ERROR, "failed to decipher query plan");
+ elog(ERROR, "test_predtest query must be a SELECT");
plan = stmt->planTree;
Assert(list_length(plan->targetlist) >= 2);
clause1 = linitial_node(TargetEntry, plan->targetlist)->expr;