Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
9b73210f
Commit
9b73210f
authored
26 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Fix bootstrap so it properly defines alignment of attributes.
parent
f821eece
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/bootstrap/bootstrap.c
+10
-8
10 additions, 8 deletions
src/backend/bootstrap/bootstrap.c
src/backend/catalog/index.c
+7
-6
7 additions, 6 deletions
src/backend/catalog/index.c
with
17 additions
and
14 deletions
src/backend/bootstrap/bootstrap.c
+
10
−
8
View file @
9b73210f
...
...
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.4
8
1998/08/
19 02:01:26
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.4
9
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
t
ypeoid
;
if
(
reldesc
!=
NULL
)
{
...
...
@@ -579,7 +579,7 @@ DefineAttr(char *name, char *type, int attnum)
closerel
(
relname
);
}
t
=
gettype
(
type
);
t
ypeoid
=
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
[
t
ypeoid
].
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
;
...
...
This diff is collapsed.
Click to expand it.
src/backend/catalog/index.c
+
7
−
6
View file @
9b73210f
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.5
2
1998/08/2
1 23:22:3
4 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.5
3
1998/08/2
4 19:04:0
4 momjian Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -279,6 +279,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
funcTupDesc
->
attrs
[
0
]
->
attbyval
=
((
TypeTupleForm
)
GETSTRUCT
(
tuple
))
->
typbyval
;
funcTupDesc
->
attrs
[
0
]
->
attcacheoff
=
-
1
;
funcTupDesc
->
attrs
[
0
]
->
atttypmod
=
-
1
;
funcTupDesc
->
attrs
[
0
]
->
attalign
=
((
TypeTupleForm
)
GETSTRUCT
(
tuple
))
->
typalign
;
/*
* make the attributes name the same as the functions
...
...
@@ -378,7 +379,6 @@ ConstructTupleDescriptor(Oid heapoid,
* here we are indexing on a normal attribute (1...n)
* ----------------
*/
heapTupDesc
=
RelationGetTupleDescriptor
(
heapRelation
);
atind
=
AttrNumberGetAttrOffset
(
atnum
);
...
...
@@ -400,6 +400,7 @@ ConstructTupleDescriptor(Oid heapoid,
((
AttributeTupleForm
)
to
)
->
atthasdef
=
false
;
((
AttributeTupleForm
)
to
)
->
attcacheoff
=
-
1
;
((
AttributeTupleForm
)
to
)
->
atttypmod
=
-
1
;
((
AttributeTupleForm
)
to
)
->
attalign
=
'i'
;
/*
* if the keytype is defined, we need to change the tuple form's
...
...
@@ -417,11 +418,11 @@ ConstructTupleDescriptor(Oid heapoid,
IndexKeyType
->
name
);
((
AttributeTupleForm
)
to
)
->
atttypid
=
tup
->
t_oid
;
((
AttributeTupleForm
)
to
)
->
attbyval
=
((
TypeTupleForm
)
((
char
*
)
tup
+
tup
->
t_hoff
))
->
typbyval
;
((
TypeTupleForm
)
GETSTRUCT
(
tup
))
->
typbyval
;
((
AttributeTupleForm
)
to
)
->
attlen
=
((
TypeTupleForm
)
((
char
*
)
tup
+
tup
->
t_hoff
))
->
typlen
;
((
TypeTupleForm
)
GETSTRUCT
(
tup
))
->
typlen
;
((
AttributeTupleForm
)
to
)
->
attalign
=
((
TypeTupleForm
)
GETSTRUCT
(
tup
))
->
typalign
;
((
AttributeTupleForm
)
to
)
->
atttypmod
=
IndexKeyType
->
typmod
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment