MCPcopy Create free account
hub / github.com/apache/cloudberry / element_compare

Function element_compare

src/backend/utils/adt/array_selfuncs.c:1165–1176  ·  view source on GitHub ↗

* Comparison function for elements. * * We use the element type's default btree opclass, and its default collation * if the type is collation-sensitive. * * XXX consider using SortSupport infrastructure */

Source from the content-addressed store, hash-verified

1163 * XXX consider using SortSupport infrastructure
1164 */
1165static int
1166element_compare(const void *key1, const void *key2, void *arg)
1167{
1168 Datum d1 = *((const Datum *) key1);
1169 Datum d2 = *((const Datum *) key2);
1170 TypeCacheEntry *typentry = (TypeCacheEntry *) arg;
1171 FmgrInfo *cmpfunc = &typentry->cmp_proc_finfo;
1172 Datum c;
1173
1174 c = FunctionCall2Coll(cmpfunc, typentry->typcollation, d1, d2);
1175 return DatumGetInt32(c);
1176}
1177
1178/*
1179 * Comparison function for sorting floats into descending order.

Callers 3

find_next_mcelemFunction · 0.70

Calls 2

FunctionCall2CollFunction · 0.85
DatumGetInt32Function · 0.85

Tested by

no test coverage detected