7
7
* Copyright (c) 1994, Regents of the University of California
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.48 1998/08/19 02:01:26 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.49 1998/08/24 19:04:02 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -90,7 +90,7 @@ static AttributeTupleForm AllocateAttribute(void);
90
90
static bool BootstrapAlreadySeen (Oid id );
91
91
static int CompHash (char * str , int len );
92
92
static hashnode * FindStr (char * str , int length , hashnode * mderef );
93
- static int gettype (char * type );
93
+ static Oid gettype (char * type );
94
94
static void cleanup (void );
95
95
96
96
/* ----------------
@@ -571,15 +571,15 @@ void
571
571
DefineAttr (char * name , char * type , int attnum )
572
572
{
573
573
int attlen ;
574
- int t ;
574
+ Oid typeoid ;
575
575
576
576
if (reldesc != NULL )
577
577
{
578
578
fputs ("Warning: no open relations allowed with 't' command.\n" , stderr );
579
579
closerel (relname );
580
580
}
581
581
582
- t = gettype (type );
582
+ typeoid = gettype (type );
583
583
if (attrtypes [attnum ] == (AttributeTupleForm ) NULL )
584
584
attrtypes [attnum ] = AllocateAttribute ();
585
585
if (Typ != (struct typmap * * ) NULL )
@@ -591,16 +591,18 @@ DefineAttr(char *name, char *type, int attnum)
591
591
attrtypes [attnum ]-> attnum = 1 + attnum ; /* fillatt */
592
592
attlen = attrtypes [attnum ]-> attlen = Ap -> am_typ .typlen ;
593
593
attrtypes [attnum ]-> attbyval = Ap -> am_typ .typbyval ;
594
+ attrtypes [attnum ]-> attalign = Ap -> am_typ .typalign ;
594
595
}
595
596
else
596
597
{
597
- attrtypes [attnum ]-> atttypid = Procid [t ].oid ;
598
+ attrtypes [attnum ]-> atttypid = Procid [typeoid ].oid ;
598
599
namestrcpy (& attrtypes [attnum ]-> attname , name );
599
600
if (!Quiet )
600
601
printf ("<%s %s> " , attrtypes [attnum ]-> attname .data , type );
601
602
attrtypes [attnum ]-> attnum = 1 + attnum ; /* fillatt */
602
- attlen = attrtypes [attnum ]-> attlen = Procid [t ].len ;
603
- attrtypes [attnum ]-> attbyval = (attlen == 1 ) || (attlen == 2 ) || (attlen == 4 );
603
+ attlen = attrtypes [attnum ]-> attlen = Procid [typeoid ].len ;
604
+ attrtypes [attnum ]-> attbyval = (attlen == 1 ) || (attlen == 2 ) || (attlen == 4 );
605
+ attrtypes [attnum ]-> attalign = 'i' ;
604
606
}
605
607
attrtypes [attnum ]-> attcacheoff = -1 ;
606
608
attrtypes [attnum ]-> atttypmod = -1 ;
@@ -784,7 +786,7 @@ cleanup()
784
786
* gettype
785
787
* ----------------
786
788
*/
787
- static int
789
+ static Oid
788
790
gettype (char * type )
789
791
{
790
792
int i ;
0 commit comments