mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Code review for improved-hashing patch. Fix some portability issues
(char != unsigned char, Datum != uint32); make use of new hash code in dynahash hash tables and hash joins.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.64 2001/11/21 05:57:33 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/date.c,v 1.65 2002/03/09 17:35:35 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1116,7 +1116,7 @@ timetz_hash(PG_FUNCTION_ARGS)
|
||||
* sizeof(TimeTzADT), so that any garbage pad bytes in the structure
|
||||
* won't be included in the hash!
|
||||
*/
|
||||
return hash_any((char *) key, sizeof(double) + sizeof(int4));
|
||||
return hash_any((unsigned char *) key, sizeof(double) + sizeof(int4));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* PostgreSQL type definitions for MAC addresses.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.21 2001/08/21 21:23:21 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/mac.c,v 1.22 2002/03/09 17:35:35 tgl Exp $
|
||||
*/
|
||||
|
||||
#include "postgres.h"
|
||||
@@ -230,7 +230,7 @@ hashmacaddr(PG_FUNCTION_ARGS)
|
||||
{
|
||||
macaddr *key = PG_GETARG_MACADDR_P(0);
|
||||
|
||||
return hash_any((char *) key, sizeof(macaddr));
|
||||
return hash_any((unsigned char *) key, sizeof(macaddr));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.64 2002/03/06 06:10:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/timestamp.c,v 1.65 2002/03/09 17:35:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -1017,7 +1017,7 @@ interval_hash(PG_FUNCTION_ARGS)
|
||||
* sizeof(Interval), so that any garbage pad bytes in the structure
|
||||
* won't be included in the hash!
|
||||
*/
|
||||
return hash_any((char *) key, sizeof(double) + sizeof(int4));
|
||||
return hash_any((unsigned char *) key, sizeof(double) + sizeof(int4));
|
||||
}
|
||||
|
||||
/* overlaps_timestamp() --- implements the SQL92 OVERLAPS operator.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.87 2001/11/18 12:07:07 ishii Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.88 2002/03/09 17:35:36 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -791,7 +791,7 @@ hashbpchar(PG_FUNCTION_ARGS)
|
||||
keydata = VARDATA(key);
|
||||
keylen = bcTruelen(key);
|
||||
|
||||
result = hash_any(keydata, keylen);
|
||||
result = hash_any((unsigned char *) keydata, keylen);
|
||||
|
||||
/* Avoid leaking memory for toasted inputs */
|
||||
PG_FREE_IF_COPY(key, 0);
|
||||
|
||||
Reference in New Issue
Block a user