diff options
Diffstat (limited to 'src/backend/optimizer/util/predtest.c')
-rw-r--r-- | src/backend/optimizer/util/predtest.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/predtest.c b/src/backend/optimizer/util/predtest.c index 4561e8e92f1..6a1f7291ba5 100644 --- a/src/backend/optimizer/util/predtest.c +++ b/src/backend/optimizer/util/predtest.c @@ -1345,6 +1345,8 @@ btree_predicate_proof(Expr *predicate, Node *clause, bool refute_it) *clause_const; bool pred_var_on_left, clause_var_on_left; + Oid pred_collation, + clause_collation; Oid pred_op, clause_op, test_op; @@ -1421,6 +1423,14 @@ btree_predicate_proof(Expr *predicate, Node *clause, bool refute_it) return false; /* + * They'd better have the same collation, too. + */ + pred_collation = ((OpExpr *) predicate)->inputcollid; + clause_collation = ((OpExpr *) clause)->inputcollid; + if (pred_collation != clause_collation) + return false; + + /* * Okay, get the operators in the two clauses we're comparing. Commute * them if needed so that we can assume the variables are on the left. */ @@ -1465,7 +1475,9 @@ btree_predicate_proof(Expr *predicate, Node *clause, bool refute_it) BOOLOID, false, (Expr *) pred_const, - (Expr *) clause_const); + (Expr *) clause_const, + InvalidOid, + pred_collation); /* Fill in opfuncids */ fix_opfuncids((Node *) test_expr); |