Skip to content

Commit 05a2759

Browse files
committed
Last-minute fix for 6.5.2: repair optimizer coredump on
CASE clauses in WHERE. Surprised no one noticed this before.
1 parent 453e30e commit 05a2759

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/backend/optimizer/path/indxpath.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.57 1999/06/19 04:54:14 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.57.2.1 1999/09/14 20:26:02 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -585,12 +585,13 @@ match_clause_to_indexkey(RelOptInfo *rel,
585585
Oid restrict_op = InvalidOid;
586586
bool isIndexable = false;
587587

588-
if (or_clause((Node *) clause) ||
589-
not_clause((Node *) clause) || single_node((Node *) clause))
590-
return (RestrictInfo *) NULL;
591-
588+
/* Clause must be a binary opclause. */
589+
if (! is_opclause((Node *) clause))
590+
return NULL;
592591
leftop = get_leftop(clause);
593592
rightop = get_rightop(clause);
593+
if (! leftop || ! rightop)
594+
return NULL;
594595

595596
/*
596597
* If this is not a join clause, check for clauses of the form:

0 commit comments

Comments
 (0)