aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-04-16 01:55:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-04-16 01:55:45 +0000
commit8064a49f6f8e38aa0ba0fd46c6903ea513014446 (patch)
tree0d1d9903a1bc78c307b151f2892169976b856445 /src
parent3e51872a98c1447677102a9d20f13cdacc2b5139 (diff)
downloadpostgresql-8064a49f6f8e38aa0ba0fd46c6903ea513014446.tar.gz
postgresql-8064a49f6f8e38aa0ba0fd46c6903ea513014446.zip
get_relattval() should treat a NULL constant as a non-constant expression,
since it has no way to indicate to its caller that the constant is actually NULL. This prevents coredump in cases like WHERE textfield < null::text;
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/util/clauses.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 7ddbe4190cc..0404dce9385 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.65 2000/04/12 17:15:24 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/util/clauses.c,v 1.66 2000/04/16 01:55:45 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -790,7 +790,8 @@ default_results:
other = (*flag == 0) ? left : right;
- if (IsA(other, Const))
+ if (IsA(other, Const) &&
+ !((Const *) other)->constisnull)
{
*constval = ((Const *) other)->constvalue;
*flag |= SEL_CONSTANT;