From 190c95de33c9c66543bd3c6cb67141e73d28bb16 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 3 Jan 2002 18:01:59 +0000 Subject: [PATCH] Shouldn't try to copy null datums with datumCopy. --- src/backend/optimizer/util/clauses.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index e10017f08a..3541325c97 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -1544,7 +1544,8 @@ simplify_op_or_func(Expr *expr, List *args) &const_is_null, NULL); /* Must copy result out of sub-context used by expression eval */ - const_val = datumCopy(const_val, resultTypByVal, resultTypLen); + if (!const_is_null) + const_val = datumCopy(const_val, resultTypByVal, resultTypLen); FreeExprContext(econtext); pfree(newexpr); -- 2.39.5