Minimal fix for crash bug in quals_match_foreign_key.

Discussion is still underway as to whether to revert the entire patch
that added this function, but that discussion may not conclude before
beta1.  So, in the meantime, let's do at least this much.

David Rowley
This commit is contained in:
Robert Haas 2016-05-06 15:00:55 -04:00
parent c7ea68ff8d
commit 68d704edbf
1 changed files with 4 additions and 4 deletions

View File

@ -3944,13 +3944,13 @@ quals_match_foreign_key(PlannerInfo *root, ForeignKeyOptInfo *fkinfo,
if (i > 0 && bms_is_member(quallstidx, qualmatches))
continue;
/*
* Here since 'usefulquals' only contains bitmap indexes for quals
* of type "var op var" we can safely skip checking this.
*/
rinfo = (RestrictInfo *) lfirst(lc);
clause = (OpExpr *) rinfo->clause;
/* only OpExprs are useful for consideration */
if (!IsA(clause, OpExpr))
continue;
/*
* If the operator does not match then there's little point in
* checking the operands.