*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.15 2005/05/29 04:23:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.16 2005/10/15 02:49:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
oldContext = MemoryContextSwitchTo(evalContext);
/*
- * We cannot report a match without checking all the fields, but we
- * can report a non-match as soon as we find unequal fields. So,
- * start comparing at the last field (least significant sort key).
- * That's the most likely to be different if we are dealing with
- * sorted input.
+ * We cannot report a match without checking all the fields, but we can
+ * report a non-match as soon as we find unequal fields. So, start
+ * comparing at the last field (least significant sort key). That's the
+ * most likely to be different if we are dealing with sorted input.
*/
result = true;
oldContext = MemoryContextSwitchTo(evalContext);
/*
- * We cannot report a match without checking all the fields, but we
- * can report a non-match as soon as we find unequal fields. So,
- * start comparing at the last field (least significant sort key).
- * That's the most likely to be different if we are dealing with
- * sorted input.
+ * We cannot report a match without checking all the fields, but we can
+ * report a non-match as soon as we find unequal fields. So, start
+ * comparing at the last field (least significant sort key). That's the
+ * most likely to be different if we are dealing with sorted input.
*/
result = false;
Assert(entrysize >= sizeof(TupleHashEntryData));
hashtable = (TupleHashTable) MemoryContextAlloc(tablecxt,
- sizeof(TupleHashTableData));
+ sizeof(TupleHashTableData));
hashtable->numCols = numCols;
hashtable->keyColIdx = keyColIdx;
hashtable->tablecxt = tablecxt;
hashtable->tempcxt = tempcxt;
hashtable->entrysize = entrysize;
- hashtable->tableslot = NULL; /* will be made on first lookup */
+ hashtable->tableslot = NULL; /* will be made on first lookup */
hashtable->inputslot = NULL;
MemSet(&hash_ctl, 0, sizeof(hash_ctl));
hash_ctl.hcxt = tablecxt;
hashtable->hashtab = hash_create("TupleHashTable", (long) nbuckets,
&hash_ctl,
- HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
+ HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
return hashtable;
}
TupleDesc tupdesc;
oldContext = MemoryContextSwitchTo(hashtable->tablecxt);
+
/*
* We copy the input tuple descriptor just for safety --- we assume
* all input tuples will have equivalent descriptors.
/*
* created new entry
*
- * Zero any caller-requested space in the entry. (This zaps
- * the "key data" dynahash.c copied into the new entry, but we
- * don't care since we're about to overwrite it anyway.)
+ * Zero any caller-requested space in the entry. (This zaps the "key
+ * data" dynahash.c copied into the new entry, but we don't care
+ * since we're about to overwrite it anyway.)
*/
MemSet(entry, 0, hashtable->entrysize);
TupleHashTableMatch(const void *key1, const void *key2, Size keysize)
{
HeapTuple tuple1 = ((const TupleHashEntryData *) key1)->firstTuple;
+
#ifdef USE_ASSERT_CHECKING
HeapTuple tuple2 = ((const TupleHashEntryData *) key2)->firstTuple;
#endif