* findPartialMatch: does the hashtable contain an entry that is not * provably distinct from the tuple? * * We have to scan the whole hashtable; we can't usefully use hashkeys * to guide probing, since we might get partial matches on tuples with * hashkeys quite unrelated to what we'd get from the given tuple. * * Caller must provide the equality functions to use, since in cross-type * cas
| 726 | * cases these are different from the hashtable's internal functions. |
| 727 | */ |
| 728 | static bool |
| 729 | findPartialMatch(TupleHashTable hashtable, TupleTableSlot *slot, |
| 730 | FmgrInfo *eqfunctions) |
| 731 | { |
| 732 | int numCols = hashtable->numCols; |
| 733 | AttrNumber *keyColIdx = hashtable->keyColIdx; |
| 734 | TupleHashIterator hashiter; |
| 735 | TupleHashEntry entry; |
| 736 | |
| 737 | InitTupleHashIterator(hashtable, &hashiter); |
| 738 | while ((entry = ScanTupleHashTable(hashtable, &hashiter)) != NULL) |
| 739 | { |
| 740 | CHECK_FOR_INTERRUPTS(); |
| 741 | |
| 742 | ExecStoreMinimalTuple(entry->firstTuple, hashtable->tableslot, false); |
| 743 | if (!execTuplesUnequal(slot, hashtable->tableslot, |
| 744 | numCols, keyColIdx, |
| 745 | eqfunctions, |
| 746 | hashtable->tab_collations, |
| 747 | hashtable->tempcxt)) |
| 748 | { |
| 749 | TermTupleHashIterator(&hashiter); |
| 750 | return true; |
| 751 | } |
| 752 | } |
| 753 | /* No TermTupleHashIterator call needed here */ |
| 754 | return false; |
| 755 | } |
| 756 | |
| 757 | /* |
| 758 | * slotAllNulls: is the slot completely NULL? |
no test coverage detected