mirror of
https://github.com/postgres/postgres.git
synced 2025-08-30 06:01:21 +03:00
Re-apply Darren's char2-16 removal code.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.38 1998/04/07 18:09:44 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.39 1998/04/26 04:05:02 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* some of the executor utility code such as "ExecTypeFromTL" should be
|
||||
@@ -317,7 +317,7 @@ TupleDescInitEntry(TupleDesc desc,
|
||||
*
|
||||
* Note: in the special case of
|
||||
*
|
||||
* create EMP (name = char16, manager = EMP)
|
||||
* create EMP (name = text, manager = EMP)
|
||||
*
|
||||
* RelationNameCreateHeapRelation() calls BuildDesc() which
|
||||
* calls this routine and since EMP does not exist yet, the
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.8 1998/04/07 18:09:46 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.9 1998/04/26 04:05:08 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -133,6 +133,8 @@ hashoid(Oid key)
|
||||
return ((uint32) ~key);
|
||||
}
|
||||
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
|
||||
uint32
|
||||
hashchar(char key)
|
||||
@@ -140,12 +142,8 @@ hashchar(char key)
|
||||
int len;
|
||||
uint32 h;
|
||||
|
||||
len = sizeof(char);
|
||||
|
||||
#define PRIME1 37
|
||||
#define PRIME2 1048583
|
||||
|
||||
h = 0;
|
||||
len = sizeof(char);
|
||||
/* Convert char to integer */
|
||||
h = h * PRIME1 ^ (key - ' ');
|
||||
h %= PRIME2;
|
||||
@@ -153,55 +151,6 @@ hashchar(char key)
|
||||
return (h);
|
||||
}
|
||||
|
||||
uint32
|
||||
hashchar2(uint16 intkey)
|
||||
{
|
||||
uint32 h;
|
||||
int len;
|
||||
char *key = (char *) &intkey;
|
||||
|
||||
h = 0;
|
||||
len = sizeof(uint16);
|
||||
/* Convert string to integer */
|
||||
while (len--)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
}
|
||||
|
||||
uint32
|
||||
hashchar4(uint32 intkey)
|
||||
{
|
||||
uint32 h;
|
||||
int len;
|
||||
char *key = (char *) &intkey;
|
||||
|
||||
h = 0;
|
||||
len = sizeof(uint32);
|
||||
/* Convert string to integer */
|
||||
while (len--)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
}
|
||||
|
||||
uint32
|
||||
hashchar8(char *key)
|
||||
{
|
||||
uint32 h;
|
||||
int len;
|
||||
|
||||
h = 0;
|
||||
len = sizeof(char8);
|
||||
/* Convert string to integer */
|
||||
while (len--)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
}
|
||||
|
||||
uint32
|
||||
hashname(NameData *n)
|
||||
@@ -223,22 +172,6 @@ hashname(NameData *n)
|
||||
}
|
||||
|
||||
|
||||
uint32
|
||||
hashchar16(char *key)
|
||||
{
|
||||
uint32 h;
|
||||
int len;
|
||||
|
||||
h = 0;
|
||||
len = sizeof(char16);
|
||||
/* Convert string to integer */
|
||||
while (len--)
|
||||
h = h * PRIME1 ^ (*key++ - ' ');
|
||||
h %= PRIME2;
|
||||
|
||||
return (h);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (Comment from the original db3 hashing code: )
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.15 1998/04/07 18:09:51 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.16 1998/04/26 04:05:19 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* These functions are stored in pg_amproc. For each operator class
|
||||
@@ -101,30 +101,6 @@ btcharcmp(char a, char b)
|
||||
return ((int32) ((uint8) a - (uint8) b));
|
||||
}
|
||||
|
||||
int32
|
||||
btchar2cmp(uint16 a, uint16 b)
|
||||
{
|
||||
return (strncmp((char *) &a, (char *) &b, 2));
|
||||
}
|
||||
|
||||
int32
|
||||
btchar4cmp(uint32 a, uint32 b)
|
||||
{
|
||||
return (strncmp((char *) &a, (char *) &b, 4));
|
||||
}
|
||||
|
||||
int32
|
||||
btchar8cmp(char *a, char *b)
|
||||
{
|
||||
return (strncmp(a, b, 8));
|
||||
}
|
||||
|
||||
int32
|
||||
btchar16cmp(char *a, char *b)
|
||||
{
|
||||
return (strncmp(a, b, 16));
|
||||
}
|
||||
|
||||
int32
|
||||
btnamecmp(NameData *a, NameData *b)
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.15 1998/04/24 14:41:39 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.16 1998/04/26 04:05:34 momjian Exp $
|
||||
*
|
||||
* OLD COMMENTS
|
||||
* XXX WARNING
|
||||
@@ -30,14 +30,14 @@ extern TransactionId DisabledTransactionId;
|
||||
extern TransactionId AmiTransactionId;
|
||||
extern TransactionId FirstTransactionId;
|
||||
|
||||
/* XXX char16 name for catalogs */
|
||||
/* XXX name for catalogs */
|
||||
TransactionId
|
||||
xidin(char *representation)
|
||||
{
|
||||
return (atol(representation));
|
||||
}
|
||||
|
||||
/* XXX char16 name for catalogs */
|
||||
/* XXX name for catalogs */
|
||||
char *
|
||||
xidout(TransactionId transactionId)
|
||||
{
|
||||
|
Reference in New Issue
Block a user