1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-28 18:48:04 +03:00

Give inet/cidr datatypes their own hash function that ignores the inet vs

cidr type bit, the same as network_eq does.  This is needed for hash joins
and hash aggregation to work correctly on these types.  Per bug report
from Michael Fuhr, 2004-04-13.
Also, improve hash function for int8 as suggested by Greg Stark.
This commit is contained in:
Tom Lane
2004-06-13 21:57:28 +00:00
parent 0e338bba42
commit 950d047ec5
9 changed files with 77 additions and 18 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.17 2003/11/29 22:41:15 pgsql Exp $
* $PostgreSQL: pgsql/src/include/utils/inet.h,v 1.18 2004/06/13 21:57:26 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -20,10 +20,10 @@
*/
typedef struct
{
unsigned char family;
unsigned char bits;
unsigned char type;
unsigned char ip_addr[16]; /* 128 bits of address */
unsigned char family; /* PGSQL_AF_INET or PGSQL_AF_INET6 */
unsigned char bits; /* number of bits in netmask */
unsigned char type; /* 0 = inet, 1 = cidr */
unsigned char ipaddr[16]; /* up to 128 bits of address */
} inet_struct;
/*