Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d0af22a

Browse files
committed
opfamily lookup fix
1 parent bb30bce commit d0af22a

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

init.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,7 @@ load_check_constraints(Oid parent_oid, Snapshot snapshot)
398398
bool byVal = rangerel->by_val;
399399

400400
/* Sort ascending */
401-
tce = lookup_type_cache(prel->atttype,
402-
TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
401+
tce = lookup_type_cache(prel->atttype, TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
403402
qsort_type_cmp_func = &tce->cmp_proc_finfo;
404403
globalByVal = byVal;
405404
qsort(ranges, proc, sizeof(RangeEntry), cmp_range_entries);
@@ -458,7 +457,7 @@ validate_range_constraint(Expr *expr, PartRelationInfo *prel, Datum *min, Datum
458457
if (!and_clause((Node *) expr))
459458
return false;
460459

461-
tce = lookup_type_cache(prel->atttype, TYPECACHE_EQ_OPR | TYPECACHE_LT_OPR | TYPECACHE_GT_OPR);
460+
tce = lookup_type_cache(prel->atttype, TYPECACHE_BTREE_OPFAMILY);
462461

463462
/* check that left operand is >= operator */
464463
opexpr = (OpExpr *) linitial(boolexpr->args);
@@ -517,7 +516,7 @@ validate_hash_constraint(Expr *expr, PartRelationInfo *prel, int *hash)
517516
eqexpr = (OpExpr *) expr;
518517

519518
/* Is this an equality operator? */
520-
tce = lookup_type_cache(prel->atttype, TYPECACHE_EQ_OPR);
519+
tce = lookup_type_cache(prel->atttype, TYPECACHE_BTREE_OPFAMILY);
521520
if (get_op_opfamily_strategy(eqexpr->opno, tce->btree_opf) != BTEqualStrategyNumber)
522521
return false;
523522

pg_pathman.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ get_cmp_func(Oid type1, Oid type2)
209209

210210
cmp_func = palloc(sizeof(FmgrInfo));
211211
tce = lookup_type_cache(type1,
212-
TYPECACHE_EQ_OPR | TYPECACHE_LT_OPR | TYPECACHE_GT_OPR |
213-
TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
212+
TYPECACHE_BTREE_OPFAMILY | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
214213
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
215214
type1,
216215
type2,
@@ -1005,7 +1004,7 @@ handle_binary_opexpr(const PartRelationInfo *prel, WrapperNode *result,
10051004

10061005
/* Determine operator type */
10071006
tce = lookup_type_cache(v->vartype,
1008-
TYPECACHE_EQ_OPR | TYPECACHE_LT_OPR | TYPECACHE_GT_OPR | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
1007+
TYPECACHE_BTREE_OPFAMILY | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
10091008
strategy = get_op_opfamily_strategy(expr->opno, tce->btree_opf);
10101009
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
10111010
c->consttype,

0 commit comments

Comments
 (0)