* 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 */
| 1793 | * Returns InvalidOid if no operator can be found for this datatype combination |
| 1794 | */ |
| 1795 | static Oid |
| 1796 | select_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 | /* |
no test coverage detected