aboutsummaryrefslogtreecommitdiff
path: root/src/backend/bootstrap
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1998-08-24 19:04:04 +0000
committerBruce Momjian <bruce@momjian.us>1998-08-24 19:04:04 +0000
commit9b73210f9d92f3e5e48b85546c75f95a79b02df0 (patch)
tree69032081a259a77d30bf6afdee72344cdcb92e7c /src/backend/bootstrap
parentf821eece80a61c14ee07a407135b3bdac48edc6d (diff)
downloadpostgresql-9b73210f9d92f3e5e48b85546c75f95a79b02df0.tar.gz
postgresql-9b73210f9d92f3e5e48b85546c75f95a79b02df0.zip
Fix bootstrap so it properly defines alignment of attributes.
Diffstat (limited to 'src/backend/bootstrap')
-rw-r--r--src/backend/bootstrap/bootstrap.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/backend/bootstrap/bootstrap.c b/src/backend/bootstrap/bootstrap.c
index bab7d219db9..060d3e9f246 100644
--- a/src/backend/bootstrap/bootstrap.c
+++ b/src/backend/bootstrap/bootstrap.c
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.48 1998/08/19 02:01:26 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.49 1998/08/24 19:04:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -90,7 +90,7 @@ static AttributeTupleForm AllocateAttribute(void);
static bool BootstrapAlreadySeen(Oid id);
static int CompHash(char *str, int len);
static hashnode *FindStr(char *str, int length, hashnode *mderef);
-static int gettype(char *type);
+static Oid gettype(char *type);
static void cleanup(void);
/* ----------------
@@ -571,7 +571,7 @@ void
DefineAttr(char *name, char *type, int attnum)
{
int attlen;
- int t;
+ Oid typeoid;
if (reldesc != NULL)
{
@@ -579,7 +579,7 @@ DefineAttr(char *name, char *type, int attnum)
closerel(relname);
}
- t = gettype(type);
+ typeoid = gettype(type);
if (attrtypes[attnum] == (AttributeTupleForm) NULL)
attrtypes[attnum] = AllocateAttribute();
if (Typ != (struct typmap **) NULL)
@@ -591,16 +591,18 @@ DefineAttr(char *name, char *type, int attnum)
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
+ attrtypes[attnum]->attalign = Ap->am_typ.typalign;
}
else
{
- attrtypes[attnum]->atttypid = Procid[t].oid;
+ attrtypes[attnum]->atttypid = Procid[typeoid].oid;
namestrcpy(&attrtypes[attnum]->attname, name);
if (!Quiet)
printf("<%s %s> ", attrtypes[attnum]->attname.data, type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
- attlen = attrtypes[attnum]->attlen = Procid[t].len;
- attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) || (attlen == 4);
+ attlen = attrtypes[attnum]->attlen = Procid[typeoid].len;
+ attrtypes[attnum]->attbyval = (attlen == 1) || (attlen == 2) ||(attlen == 4);
+ attrtypes[attnum]->attalign = 'i';
}
attrtypes[attnum]->attcacheoff = -1;
attrtypes[attnum]->atttypmod = -1;
@@ -784,7 +786,7 @@ cleanup()
* gettype
* ----------------
*/
-static int
+static Oid
gettype(char *type)
{
int i;