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

Function select_equality_operator

src/backend/optimizer/path/equivclass.c:1795–1817  ·  view source on GitHub ↗

* select_equality_operator * Select a suitable equality operator for comparing two EC members * * Returns InvalidOid if no operator can be found for this datatype combination */

Source from the content-addressed store, hash-verified

1793 * Returns InvalidOid if no operator can be found for this datatype combination
1794 */
1795static Oid
1796select_equality_operator(EquivalenceClass *ec, Oid lefttype, Oid righttype)
1797{
1798 ListCell *lc;
1799
1800 foreach(lc, ec->ec_opfamilies)
1801 {
1802 Oid opfamily = lfirst_oid(lc);
1803 Oid opno;
1804
1805 opno = get_opfamily_member(opfamily, lefttype, righttype,
1806 BTEqualStrategyNumber);
1807 if (!OidIsValid(opno))
1808 continue;
1809 /* If no barrier quals in query, don't worry about leaky operators */
1810 if (ec->ec_max_security == 0)
1811 return opno;
1812 /* Otherwise, insist that selected operators be leakproof */
1813 if (get_func_leakproof(get_opcode(opno)))
1814 return opno;
1815 }
1816 return InvalidOid;
1817}
1818
1819
1820/*

Calls 4

get_opfamily_memberFunction · 0.85
get_func_leakproofFunction · 0.85
get_opcodeFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected