* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.333 2008/10/06 17:39:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.334 2008/10/21 20:42:52 tgl Exp $
*
*-------------------------------------------------------------------------
*/
return true;
}
+static bool
+_equalPlaceHolderVar(PlaceHolderVar *a, PlaceHolderVar *b)
+{
+ /*
+ * We intentionally do not compare phexpr. Two PlaceHolderVars with the
+ * same ID and levelsup should be considered equal even if the contained
+ * expressions have managed to mutate to different states. One way in
+ * which that can happen is that initplan sublinks would get replaced by
+ * differently-numbered Params when sublink folding is done. (The end
+ * result of such a situation would be some unreferenced initplans, which
+ * is annoying but not really a problem.)
+ *
+ * COMPARE_NODE_FIELD(phexpr);
+ */
+ COMPARE_BITMAPSET_FIELD(phrels);
+ COMPARE_SCALAR_FIELD(phid);
+ COMPARE_SCALAR_FIELD(phlevelsup);
+
+ return true;
+}
+
static bool
_equalSpecialJoinInfo(SpecialJoinInfo *a, SpecialJoinInfo *b)
{
return true;
}
+static bool
+_equalPlaceHolderInfo(PlaceHolderInfo *a, PlaceHolderInfo *b)
+{
+ COMPARE_SCALAR_FIELD(phid);
+ COMPARE_NODE_FIELD(ph_var);
+ COMPARE_BITMAPSET_FIELD(ph_eval_at);
+ COMPARE_BITMAPSET_FIELD(ph_needed);
+ COMPARE_SCALAR_FIELD(ph_width);
+
+ return true;
+}
+
/*
* Stuff from parsenodes.h
case T_FlattenedSubLink:
retval = _equalFlattenedSubLink(a, b);
break;
+ case T_PlaceHolderVar:
+ retval = _equalPlaceHolderVar(a, b);
+ break;
case T_SpecialJoinInfo:
retval = _equalSpecialJoinInfo(a, b);
break;
case T_AppendRelInfo:
retval = _equalAppendRelInfo(a, b);
break;
+ case T_PlaceHolderInfo:
+ retval = _equalPlaceHolderInfo(a, b);
+ break;
+
case T_List:
case T_IntList:
case T_OidList: