diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-05-06 15:00:55 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-05-06 15:00:55 -0400 |
commit | 68d704edbfe14fd8d21545b244c3f6824e0fbb8a (patch) | |
tree | c697c829b6b18180d5e2a1cc6471dee0fd861b2d /src | |
parent | c7ea68ff8dfafc22c6cfefdb5929e12ec5d1e02a (diff) | |
download | postgresql-68d704edbfe14fd8d21545b244c3f6824e0fbb8a.tar.gz postgresql-68d704edbfe14fd8d21545b244c3f6824e0fbb8a.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/path/costsize.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/costsize.c b/src/backend/optimizer/path/costsize.c index fcb18732d85..4c9d8d9cbd5 100644 --- a/src/backend/optimizer/path/costsize.c +++ b/src/backend/optimizer/path/costsize.c @@ -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. |