* procedural language
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.18 2000/02/07 03:39:13 inoue Exp $
+ * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.19 2000/03/11 06:19:00 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
if (plan == NULL) /* utility statement produces this */
return;
- if (nodeTag(plan) != T_Result)
+ if (! IsA(plan, Result))
return;
/* ----------
- * 3. The plan must have a single attribute as result
+ * 3. Can't have any subplan or qual clause, either
* ----------
*/
- if (length(plan->targetlist) != 1)
+ if (plan->lefttree != NULL ||
+ plan->righttree != NULL ||
+ plan->initPlan != NULL ||
+ plan->subPlan != NULL ||
+ plan->qual != NULL ||
+ ((Result *) plan)->resconstantqual != NULL)
return;
/* ----------
- * 4. Don't know if all these can break us, so let SPI handle
- * those plans
+ * 4. The plan must have a single attribute as result
* ----------
*/
- if (plan->qual != NULL || plan->lefttree != NULL || plan->righttree != NULL)
+ if (length(plan->targetlist) != 1)
return;
+ tle = (TargetEntry *) lfirst(plan->targetlist);
+
/* ----------
* 5. Check that all the nodes in the expression are one of
* Expr, Param or Const.
* ----------
*/
- tle = (TargetEntry *) lfirst(plan->targetlist);
if (!exec_simple_check_node(tle->expr))
return;
default:
expr->plan_simple_type = InvalidOid;
}
-
- return;
}