* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.301 2007/03/13 00:33:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.309 2007/06/11 01:16:22 tgl Exp $
*
*-------------------------------------------------------------------------
*/
_equalConst(Const *a, Const *b)
{
COMPARE_SCALAR_FIELD(consttype);
+ COMPARE_SCALAR_FIELD(consttypmod);
COMPARE_SCALAR_FIELD(constlen);
COMPARE_SCALAR_FIELD(constisnull);
COMPARE_SCALAR_FIELD(constbyval);
static bool
_equalArrayRef(ArrayRef *a, ArrayRef *b)
{
- COMPARE_SCALAR_FIELD(refrestype);
COMPARE_SCALAR_FIELD(refarraytype);
COMPARE_SCALAR_FIELD(refelemtype);
+ COMPARE_SCALAR_FIELD(reftypmod);
COMPARE_NODE_FIELD(refupperindexpr);
COMPARE_NODE_FIELD(reflowerindexpr);
COMPARE_NODE_FIELD(refexpr);
return true;
}
+static bool
+_equalCoerceViaIO(CoerceViaIO *a, CoerceViaIO *b)
+{
+ COMPARE_NODE_FIELD(arg);
+ COMPARE_SCALAR_FIELD(resulttype);
+
+ /*
+ * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
+ * that are equal() to both explicit and implicit coercions.
+ */
+ if (a->coerceformat != b->coerceformat &&
+ a->coerceformat != COERCE_DONTCARE &&
+ b->coerceformat != COERCE_DONTCARE)
+ return false;
+
+ return true;
+}
+
+static bool
+_equalArrayCoerceExpr(ArrayCoerceExpr *a, ArrayCoerceExpr *b)
+{
+ COMPARE_NODE_FIELD(arg);
+ COMPARE_SCALAR_FIELD(elemfuncid);
+ COMPARE_SCALAR_FIELD(resulttype);
+ COMPARE_SCALAR_FIELD(resulttypmod);
+ COMPARE_SCALAR_FIELD(isExplicit);
+
+ /*
+ * Special-case COERCE_DONTCARE, so that planner can build coercion nodes
+ * that are equal() to both explicit and implicit coercions.
+ */
+ if (a->coerceformat != b->coerceformat &&
+ a->coerceformat != COERCE_DONTCARE &&
+ b->coerceformat != COERCE_DONTCARE)
+ return false;
+
+ return true;
+}
+
static bool
_equalConvertRowtypeExpr(ConvertRowtypeExpr *a, ConvertRowtypeExpr *b)
{
return true;
}
+static bool
+_equalCurrentOfExpr(CurrentOfExpr *a, CurrentOfExpr *b)
+{
+ COMPARE_SCALAR_FIELD(cvarno);
+ COMPARE_STRING_FIELD(cursor_name);
+
+ return true;
+}
+
static bool
_equalTargetEntry(TargetEntry *a, TargetEntry *b)
{
COMPARE_BITMAPSET_FIELD(min_righthand);
COMPARE_SCALAR_FIELD(is_full_join);
COMPARE_SCALAR_FIELD(lhs_strict);
+ COMPARE_SCALAR_FIELD(delay_upper_joins);
return true;
}
COMPARE_SCALAR_FIELD(canSetTag);
COMPARE_NODE_FIELD(utilityStmt);
COMPARE_SCALAR_FIELD(resultRelation);
- COMPARE_NODE_FIELD(into);
+ COMPARE_NODE_FIELD(intoClause);
COMPARE_SCALAR_FIELD(hasAggs);
COMPARE_SCALAR_FIELD(hasSubLinks);
COMPARE_NODE_FIELD(rtable);
_equalSelectStmt(SelectStmt *a, SelectStmt *b)
{
COMPARE_NODE_FIELD(distinctClause);
- COMPARE_NODE_FIELD(into);
+ COMPARE_NODE_FIELD(intoClause);
COMPARE_NODE_FIELD(targetList);
COMPARE_NODE_FIELD(fromClause);
COMPARE_NODE_FIELD(whereClause);
return true;
}
+static bool
+_equalCreateEnumStmt(CreateEnumStmt *a, CreateEnumStmt *b)
+{
+ COMPARE_NODE_FIELD(typename);
+ COMPARE_NODE_FIELD(vals);
+
+ return true;
+}
+
static bool
_equalViewStmt(ViewStmt *a, ViewStmt *b)
{
return true;
}
+static bool
+_equalDiscardStmt(DiscardStmt *a, DiscardStmt *b)
+{
+ COMPARE_SCALAR_FIELD(target);
+
+ return true;
+}
+
static bool
_equalCreateTableSpaceStmt(CreateTableSpaceStmt *a, CreateTableSpaceStmt *b)
{
case T_RelabelType:
retval = _equalRelabelType(a, b);
break;
+ case T_CoerceViaIO:
+ retval = _equalCoerceViaIO(a, b);
+ break;
+ case T_ArrayCoerceExpr:
+ retval = _equalArrayCoerceExpr(a, b);
+ break;
case T_ConvertRowtypeExpr:
retval = _equalConvertRowtypeExpr(a, b);
break;
case T_SetToDefault:
retval = _equalSetToDefault(a, b);
break;
+ case T_CurrentOfExpr:
+ retval = _equalCurrentOfExpr(a, b);
+ break;
case T_TargetEntry:
retval = _equalTargetEntry(a, b);
break;
case T_CompositeTypeStmt:
retval = _equalCompositeTypeStmt(a, b);
break;
+ case T_CreateEnumStmt:
+ retval = _equalCreateEnumStmt(a, b);
+ break;
case T_ViewStmt:
retval = _equalViewStmt(a, b);
break;
case T_VariableResetStmt:
retval = _equalVariableResetStmt(a, b);
break;
+ case T_DiscardStmt:
+ retval = _equalDiscardStmt(a, b);
+ break;
case T_CreateTableSpaceStmt:
retval = _equalCreateTableSpaceStmt(a, b);
break;