/* Compare a simple scalar field (int, float, bool, enum, etc) */ #define COMPARE_SCALAR_FIELD(fldname) \ do { \ if (a->fldname != b->fldname) \ returnfalse; \
} while (0)
/* Compare a field that is a pointer to some kind of Node or Node tree */ #define COMPARE_NODE_FIELD(fldname) \ do { \ if (!equal(a->fldname, b->fldname)) \ returnfalse; \
} while (0)
/* Compare a field that is a pointer to a Bitmapset */ #define COMPARE_BITMAPSET_FIELD(fldname) \ do { \ if (!bms_equal(a->fldname, b->fldname)) \ returnfalse; \
} while (0)
/* Compare a field that is a pointer to a C string, or perhaps NULL */ #define COMPARE_STRING_FIELD(fldname) \ do { \ if (!equalstr(a->fldname, b->fldname)) \ returnfalse; \
} while (0)
/* Macro for comparing string fields that might be NULL */ #define equalstr(a, b) \
(((a) != NULL && (b) != NULL) ? (strcmp(a, b) == 0) : (a) == (b))
/* Compare a field that is an inline array */ #define COMPARE_ARRAY_FIELD(fldname) \ do { \ if (memcmp(a->fldname, b->fldname, sizeof(a->fldname)) != 0) \ returnfalse; \
} while (0)
/* Compare a field that is a pointer to a simple palloc'd object of size sz */ #define COMPARE_POINTER_FIELD(fldname, sz) \ do { \ if (memcmp(a->fldname, b->fldname, (sz)) != 0) \ returnfalse; \
} while (0)
/* Compare a parse location field (this is a no-op, per note above) */ #define COMPARE_LOCATION_FIELD(fldname) \
((void) 0)
/* Compare a CoercionForm field (also a no-op, per comment in primnodes.h) */ #define COMPARE_COERCIONFORM_FIELD(fldname) \
((void) 0)
/* At this point, we know extnodename is the same for both nodes. */
methods = GetExtensibleNodeMethods(a->extnodename, false);
/* compare the private fields */ if (!methods->nodeEqual(a, b)) returnfalse;
returntrue;
}
staticbool
_equalA_Const(const A_Const *a, const A_Const *b)
{
COMPARE_SCALAR_FIELD(isnull); /* Hack for in-line val field. Also val is not valid if isnull is true */ if (!a->isnull &&
!equal(&a->val, &b->val)) returnfalse;
COMPARE_LOCATION_FIELD(location);
/* *Weplacetheswitchoutsidetheloopforthesakeofefficiency;this *maynotbeworthdoing...
*/ switch (a->type)
{ case T_List:
forboth(item_a, a, item_b, b)
{ if (!equal(lfirst(item_a), lfirst(item_b))) returnfalse;
} break; case T_IntList:
forboth(item_a, a, item_b, b)
{ if (lfirst_int(item_a) != lfirst_int(item_b)) returnfalse;
} break; case T_OidList:
forboth(item_a, a, item_b, b)
{ if (lfirst_oid(item_a) != lfirst_oid(item_b)) returnfalse;
} break; case T_XidList:
forboth(item_a, a, item_b, b)
{ if (lfirst_xid(item_a) != lfirst_xid(item_b)) returnfalse;
} break; default:
elog(ERROR, "unrecognized list node type: %d",
(int) a->type); returnfalse; /* keep compiler quiet */
}
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.14Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.