From a635c08fa10fe545d723bcec6eb73bfdca07e2c0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 30 Jan 2007 01:33:36 +0000 Subject: Add support for cross-type hashing in hash index searches and hash joins. Hashing for aggregation purposes still needs work, so it's not time to mark any cross-type operators as hashable for general use, but these cases work if the operators are so marked by hand in the system catalogs. --- src/backend/executor/execGrouping.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/backend/executor/execGrouping.c') diff --git a/src/backend/executor/execGrouping.c b/src/backend/executor/execGrouping.c index f84c1120db2..08391bcc459 100644 --- a/src/backend/executor/execGrouping.c +++ b/src/backend/executor/execGrouping.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.23 2007/01/10 18:06:02 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execGrouping.c,v 1.24 2007/01/30 01:33:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -224,15 +224,18 @@ execTuplesHashPrepare(int numCols, { Oid eq_opr = eqOperators[i]; Oid eq_function; - Oid hash_function; + Oid left_hash_function; + Oid right_hash_function; eq_function = get_opcode(eq_opr); - hash_function = get_op_hash_function(eq_opr); - if (!OidIsValid(hash_function)) /* should not happen */ + if (!get_op_hash_functions(eq_opr, + &left_hash_function, &right_hash_function)) elog(ERROR, "could not find hash function for hash operator %u", eq_opr); + /* For the moment, we're not supporting cross-type cases here */ + Assert(left_hash_function == right_hash_function); fmgr_info(eq_function, &(*eqFunctions)[i]); - fmgr_info(hash_function, &(*hashFunctions)[i]); + fmgr_info(right_hash_function, &(*hashFunctions)[i]); } } -- cgit v1.2.3