postgres.git / summary / log / commit / refs
commit 0ffbe900ce599d204536b9623291e05e965da23e
Author: Peter Eisentraut <peter@eisentraut.org>
Date: Thu Sep 09 08:23:29 2021 +0000
First released in: 15.0
Fix _equalA_Const
639a86e36aaecb84faaf941dcd0b183ba0aba9e9 neglected to make the
necessary adjustments to _equalA_Const. Found only via
COPY_PARSE_PLAN_TREES.
src/backend/nodes/equalfuncs.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c
index 231380ccf74..4bad709f835 100644
--- a/src/backend/nodes/equalfuncs.c
+++ b/src/backend/nodes/equalfuncs.c
@@ -2409,8 +2409,14 @@ _equalParamRef(const ParamRef *a, const ParamRef *b)
static bool
_equalA_Const(const A_Const *a, const A_Const *b)
{
- if (!equal(&a->val, &b->val)) /* hack for in-line val field */
+ /*
+ * Hack for in-line val field. Also val is not valid is isnull is
+ * true.
+ */
+ if (!a->isnull && !b->isnull &&
+ !equal(&a->val, &b->val))
return false;
+ COMPARE_SCALAR_FIELD(isnull);
COMPARE_LOCATION_FIELD(location);
return true;
[parent: 639a86e36aae]