*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.39 2000/03/20 15:42:45 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.40 2000/03/23 07:36:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
{
Node *result;
- if (targetTypeId == InvalidOid ||
- targetTypeId == inputTypeId)
+ if (targetTypeId == inputTypeId ||
+ targetTypeId == InvalidOid ||
+ node == NULL)
{
/* no conversion needed */
result = node;
*
* Note that no folding will occur if the conversion function is
* not marked 'iscachable'.
+ *
+ * HACK: if constant is NULL, don't fold it here. This is needed
+ * by make_subplan(), which calls this routine on placeholder Const
+ * nodes that mustn't be collapsed. (It'd be a lot cleaner to make
+ * a separate node type for that purpose...)
*/
- if (IsA(node, Const))
+ if (IsA(node, Const) && ! ((Const *) node)->constisnull)
result = eval_const_expressions(result);
}
{
case (BPCHAROID):
case (VARCHAROID):
- case (BYTEA):
case (TEXTOID):
case (INT2OID):