Skip to content

Commit db21523

Browse files
committed
Back out char2-char16 removal. Add later.
1 parent 6a3c751 commit db21523

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1326
-497
lines changed

src/backend/access/common/tupdesc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.37 1998/03/30 17:22:05 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.38 1998/04/07 18:09:44 momjian Exp $
1111
*
1212
* NOTES
1313
* some of the executor utility code such as "ExecTypeFromTL" should be
@@ -317,7 +317,7 @@ TupleDescInitEntry(TupleDesc desc,
317317
*
318318
* Note: in the special case of
319319
*
320-
* create EMP (name = text, manager = EMP)
320+
* create EMP (name = char16, manager = EMP)
321321
*
322322
* RelationNameCreateHeapRelation() calls BuildDesc() which
323323
* calls this routine and since EMP does not exist yet, the

src/backend/access/hash/hashfunc.c

+71-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.7 1998/03/30 17:22:08 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/hash/hashfunc.c,v 1.8 1998/04/07 18:09:46 momjian Exp $
1111
*
1212
* NOTES
1313
* These functions are stored in pg_amproc. For each operator class
@@ -133,24 +133,75 @@ hashoid(Oid key)
133133
return ((uint32) ~key);
134134
}
135135

136-
#define PRIME1 37
137-
#define PRIME2 1048583
138136

139137
uint32
140138
hashchar(char key)
141139
{
142140
int len;
143141
uint32 h;
144142

145-
h = 0;
146143
len = sizeof(char);
144+
145+
#define PRIME1 37
146+
#define PRIME2 1048583
147+
148+
h = 0;
147149
/* Convert char to integer */
148150
h = h * PRIME1 ^ (key - ' ');
149151
h %= PRIME2;
150152

151153
return (h);
152154
}
153155

156+
uint32
157+
hashchar2(uint16 intkey)
158+
{
159+
uint32 h;
160+
int len;
161+
char *key = (char *) &intkey;
162+
163+
h = 0;
164+
len = sizeof(uint16);
165+
/* Convert string to integer */
166+
while (len--)
167+
h = h * PRIME1 ^ (*key++ - ' ');
168+
h %= PRIME2;
169+
170+
return (h);
171+
}
172+
173+
uint32
174+
hashchar4(uint32 intkey)
175+
{
176+
uint32 h;
177+
int len;
178+
char *key = (char *) &intkey;
179+
180+
h = 0;
181+
len = sizeof(uint32);
182+
/* Convert string to integer */
183+
while (len--)
184+
h = h * PRIME1 ^ (*key++ - ' ');
185+
h %= PRIME2;
186+
187+
return (h);
188+
}
189+
190+
uint32
191+
hashchar8(char *key)
192+
{
193+
uint32 h;
194+
int len;
195+
196+
h = 0;
197+
len = sizeof(char8);
198+
/* Convert string to integer */
199+
while (len--)
200+
h = h * PRIME1 ^ (*key++ - ' ');
201+
h %= PRIME2;
202+
203+
return (h);
204+
}
154205

155206
uint32
156207
hashname(NameData *n)
@@ -172,6 +223,22 @@ hashname(NameData *n)
172223
}
173224

174225

226+
uint32
227+
hashchar16(char *key)
228+
{
229+
uint32 h;
230+
int len;
231+
232+
h = 0;
233+
len = sizeof(char16);
234+
/* Convert string to integer */
235+
while (len--)
236+
h = h * PRIME1 ^ (*key++ - ' ');
237+
h %= PRIME2;
238+
239+
return (h);
240+
}
241+
175242

176243
/*
177244
* (Comment from the original db3 hashing code: )

src/backend/access/nbtree/nbtcompare.c

+25-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.14 1998/03/30 17:22:17 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtcompare.c,v 1.15 1998/04/07 18:09:51 momjian Exp $
1111
*
1212
* NOTES
1313
* These functions are stored in pg_amproc. For each operator class
@@ -101,6 +101,30 @@ btcharcmp(char a, char b)
101101
return ((int32) ((uint8) a - (uint8) b));
102102
}
103103

104+
int32
105+
btchar2cmp(uint16 a, uint16 b)
106+
{
107+
return (strncmp((char *) &a, (char *) &b, 2));
108+
}
109+
110+
int32
111+
btchar4cmp(uint32 a, uint32 b)
112+
{
113+
return (strncmp((char *) &a, (char *) &b, 4));
114+
}
115+
116+
int32
117+
btchar8cmp(char *a, char *b)
118+
{
119+
return (strncmp(a, b, 8));
120+
}
121+
122+
int32
123+
btchar16cmp(char *a, char *b)
124+
{
125+
return (strncmp(a, b, 16));
126+
}
127+
104128
int32
105129
btnamecmp(NameData *a, NameData *b)
106130
{

src/backend/access/transam/xid.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.13 1998/03/30 17:22:28 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/transam/Attic/xid.c,v 1.14 1998/04/07 18:10:01 momjian Exp $
1111
*
1212
* OLD COMMENTS
1313
* XXX WARNING
@@ -30,14 +30,14 @@ extern TransactionId DisabledTransactionId;
3030
extern TransactionId AmiTransactionId;
3131
extern TransactionId FirstTransactionId;
3232

33-
/* XXX name for catalogs */
33+
/* XXX char16 name for catalogs */
3434
TransactionId
3535
xidin(char *representation)
3636
{
3737
return (atol(representation));
3838
}
3939

40-
/* XXX name for catalogs */
40+
/* XXX char16 name for catalogs */
4141
char *
4242
xidout(TransactionId transactionId)
4343
{

src/backend/bootstrap/bootparse.y

+31-25
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,53 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.14 1998/03/30 17:22:44 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.15 1998/04/07 18:10:11 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515

16-
#include <stdio.h>
17-
#include <time.h>
18-
1916
#include "postgres.h"
2017

21-
#include "miscadmin.h"
22-
18+
#include "catalog/pg_attribute.h"
2319
#include "access/attnum.h"
24-
#include "access/funcindex.h"
25-
#include "access/htup.h"
26-
#include "access/itup.h"
27-
#include "access/skey.h"
28-
#include "access/strat.h"
20+
#include "nodes/pg_list.h"
2921
#include "access/tupdesc.h"
30-
#include "access/xact.h"
31-
#include "bootstrap/bootstrap.h"
32-
#include "catalog/heap.h"
22+
#include "storage/fd.h"
3323
#include "catalog/pg_am.h"
34-
#include "catalog/pg_attribute.h"
3524
#include "catalog/pg_class.h"
36-
#include "commands/defrem.h"
3725
#include "nodes/nodes.h"
38-
#include "nodes/parsenodes.h"
39-
#include "nodes/pg_list.h"
40-
#include "nodes/primnodes.h"
4126
#include "rewrite/prs2lock.h"
27+
#include "access/skey.h"
28+
#include "access/strat.h"
29+
#include "utils/rel.h"
30+
31+
#include "nodes/primnodes.h"
32+
#include <time.h>
33+
#include "utils/nabstime.h"
4234
#include "storage/block.h"
43-
#include "storage/fd.h"
44-
#include "storage/ipc.h"
45-
#include "storage/itemptr.h"
4635
#include "storage/off.h"
47-
#include "storage/smgr.h"
36+
#include "storage/itemptr.h"
37+
#include "access/htup.h"
38+
#include "nodes/parsenodes.h"
39+
40+
#include "access/xact.h"
41+
42+
#include <stdio.h>
43+
44+
#include "catalog/heap.h"
45+
46+
#include "storage/ipc.h"
4847
#include "storage/spin.h"
48+
#include "storage/smgr.h"
49+
4950
#include "tcop/dest.h"
50-
#include "utils/nabstime.h"
51-
#include "utils/rel.h"
51+
#include "commands/defrem.h"
52+
53+
#include "access/itup.h"
54+
#include "access/funcindex.h"
55+
#include "bootstrap/bootstrap.h"
56+
57+
#include "miscadmin.h"
5258

5359
#define DO_START { \
5460
StartTransactionCommand();\

0 commit comments

Comments
 (0)