mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
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.
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user