Skip to content

Commit f7fb29d

Browse files
committed
Shouldn't try to copy null datums with datumCopy.
1 parent b8ef396 commit f7fb29d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/optimizer/util/clauses.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.92 2001/12/10 22:54:12 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.93 2002/01/03 18:01:59 tgl Exp $
1212
*
1313
* HISTORY
1414
* AUTHOR DATE MAJOR EVENT
@@ -1544,7 +1544,8 @@ simplify_op_or_func(Expr *expr, List *args)
15441544
&const_is_null, NULL);
15451545

15461546
/* Must copy result out of sub-context used by expression eval */
1547-
const_val = datumCopy(const_val, resultTypByVal, resultTypLen);
1547+
if (!const_is_null)
1548+
const_val = datumCopy(const_val, resultTypByVal, resultTypLen);
15481549

15491550
FreeExprContext(econtext);
15501551
pfree(newexpr);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy