From 1d41739e5a04b0e93304d24d864b6bfa3efc45f2 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 6 Aug 2014 16:06:06 -0400 Subject: Don't require sort support functions to provide a comparator. This could be useful for datatypes like text, where we might want to optimize for some collations but not others. However, this patch doesn't introduce any new sortsupport functions that work this way; it merely revises the code so that future patches may do so. Patch by me. Review by Peter Geoghegan. --- src/backend/executor/nodeMergejoin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/backend/executor/nodeMergejoin.c') diff --git a/src/backend/executor/nodeMergejoin.c b/src/backend/executor/nodeMergejoin.c index bc036a30b0d..fdf2f4c1a85 100644 --- a/src/backend/executor/nodeMergejoin.c +++ b/src/backend/executor/nodeMergejoin.c @@ -230,19 +230,19 @@ MJExamineQuals(List *mergeclauses, qual->opno); /* And get the matching support or comparison function */ + Assert(clause->ssup.comparator == NULL); sortfunc = get_opfamily_proc(opfamily, op_lefttype, op_righttype, BTSORTSUPPORT_PROC); if (OidIsValid(sortfunc)) { - /* The sort support function should provide a comparator */ + /* The sort support function can provide a comparator */ OidFunctionCall1(sortfunc, PointerGetDatum(&clause->ssup)); - Assert(clause->ssup.comparator != NULL); } - else + if (clause->ssup.comparator == NULL) { - /* opfamily doesn't provide sort support, get comparison func */ + /* support not available, get comparison func */ sortfunc = get_opfamily_proc(opfamily, op_lefttype, op_righttype, -- cgit v1.2.3