From f7fb29dec3a6c924931078f29dc56991333c8693 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index b3d5043356..8a4bcf4d9c 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.92 2001/12/10 22:54:12 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.93 2002/01/03 18:01:59 tgl Exp $ * * HISTORY * AUTHOR DATE MAJOR EVENT @@ -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);