summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane1999-09-14 20:26:02 +0000
committerTom Lane1999-09-14 20:26:02 +0000
commit05a275926b95cef0c8844b45929940e11b24ea3b (patch)
tree7b2d0ff6b27b09dd14e1ba4219295f7b1fb1f603
parent453e30e523bdf3b7dbe334f6a7bc99de4340b0cf (diff)
Last-minute fix for 6.5.2: repair optimizer coredump on
CASE clauses in WHERE. Surprised no one noticed this before.
-rw-r--r--src/backend/optimizer/path/indxpath.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c
index e1870912bff..2b830f91c6c 100644
--- a/src/backend/optimizer/path/indxpath.c
+++ b/src/backend/optimizer/path/indxpath.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.57 1999/06/19 04:54:14 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.57.2.1 1999/09/14 20:26:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -585,12 +585,13 @@ match_clause_to_indexkey(RelOptInfo *rel,
Oid restrict_op = InvalidOid;
bool isIndexable = false;
- if (or_clause((Node *) clause) ||
- not_clause((Node *) clause) || single_node((Node *) clause))
- return (RestrictInfo *) NULL;
-
+ /* Clause must be a binary opclause. */
+ if (! is_opclause((Node *) clause))
+ return NULL;
leftop = get_leftop(clause);
rightop = get_rightop(clause);
+ if (! leftop || ! rightop)
+ return NULL;
/*
* If this is not a join clause, check for clauses of the form: