Skip to content

Commit 611019f

Browse files
committed
pathman: opfamily lookup fix
1 parent 1e82dc7 commit 611019f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

contrib/pg_pathman/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

contrib/pg_pathman/pg_pathman.c

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

224224
cmp_func = palloc(sizeof(FmgrInfo));
225225
tce = lookup_type_cache(type1,
226-
TYPECACHE_EQ_OPR | TYPECACHE_LT_OPR | TYPECACHE_GT_OPR |
227-
TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
226+
TYPECACHE_BTREE_OPFAMILY | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
228227
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
229228
type1,
230229
type2,
@@ -1019,7 +1018,7 @@ handle_binary_opexpr(const PartRelationInfo *prel, WrapperNode *result,
10191018

10201019
/* Determine operator type */
10211020
tce = lookup_type_cache(v->vartype,
1022-
TYPECACHE_EQ_OPR | TYPECACHE_LT_OPR | TYPECACHE_GT_OPR | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
1021+
TYPECACHE_BTREE_OPFAMILY | TYPECACHE_CMP_PROC | TYPECACHE_CMP_PROC_FINFO);
10231022
strategy = get_op_opfamily_strategy(expr->opno, tce->btree_opf);
10241023
cmp_proc_oid = get_opfamily_proc(tce->btree_opf,
10251024
c->consttype,

0 commit comments

Comments
 (0)