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
04abb541
Commit
04abb541
authored
26 years ago
by
Vadim B. Mikheev
Browse files
Options
Downloads
Patches
Plain Diff
Fix for indexing problem (?): heap tuple was pfree-d before CatalogIndexInsert()...
parent
b5ed4be2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/catalog/index.c
+21
-14
21 additions, 14 deletions
src/backend/catalog/index.c
with
21 additions
and
14 deletions
src/backend/catalog/index.c
+
21
−
14
View file @
04abb541
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
1
1998/09/0
7
0
5:35:37 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
2
1998/09/0
9
0
3:42:52 vadim
Exp $
*
*
* INTERFACE ROUTINES
...
...
@@ -64,7 +64,8 @@
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
/* non-export function prototypes */
static
Oid
RelationNameGetObjectId
(
char
*
relationName
,
Relation
pg_class
);
static
Oid
RelationNameGetObjectId
(
char
*
relationName
,
Relation
pg_class
);
static
Oid
GetHeapRelationOid
(
char
*
heapRelationName
,
char
*
indexRelationName
);
static
TupleDesc
BuildFuncTupleDesc
(
FuncIndexInfo
*
funcInfo
);
static
TupleDesc
ConstructTupleDescriptor
(
Oid
heapoid
,
Relation
heapRelation
,
...
...
@@ -76,7 +77,8 @@ static Oid UpdateRelationRelation(Relation indexRelation);
static
void
InitializeAttributeOids
(
Relation
indexRelation
,
int
numatts
,
Oid
indexoid
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
UpdateIndexRelation
(
Oid
indexoid
,
Oid
heapoid
,
FuncIndexInfo
*
funcInfo
,
int
natts
,
AttrNumber
*
attNums
,
Oid
*
classOids
,
Node
*
predicate
,
...
...
@@ -550,9 +552,11 @@ UpdateRelationRelation(Relation indexRelation)
sizeof
(
*
indexRelation
->
rd_rel
),
(
char
*
)
indexRelation
->
rd_rel
);
/*
* The new tuple must have the same oid as the heap_create() we just
* did.
/* ----------------
* the new tuple must have the same oid as the relcache entry for the
* index. sure would be embarassing to do this sort of thing in polite
* company.
* ----------------
*/
tuple
->
t_oid
=
RelationGetRelid
(
indexRelation
);
heap_insert
(
pg_class
,
tuple
);
...
...
@@ -1074,7 +1078,7 @@ index_create(char *heapRelationName,
/* ----------------
* add index to catalogs
* (
INSERT pg_class
tuple)
* (
append RELATION
tuple)
* ----------------
*/
indexoid
=
UpdateRelationRelation
(
indexRelation
);
...
...
@@ -1260,7 +1264,8 @@ FormIndexDatum(int numberOfAttributes,
char
*
nullv
,
FuncIndexInfoPtr
fInfo
)
{
AttrNumber
attOff
;
AttrNumber
i
;
int
offset
;
bool
isNull
;
/* ----------------
...
...
@@ -1270,16 +1275,18 @@ FormIndexDatum(int numberOfAttributes,
* ----------------
*/
for
(
attOff
=
0
;
attOff
<
numberOfAttributes
;
attOff
++
)
for
(
i
=
1
;
i
<
=
numberOfAttributes
;
i
++
)
{
datum
[
attOff
]
=
PointerGetDatum
(
GetIndexValue
(
heapTuple
,
offset
=
AttrNumberGetAttrOffset
(
i
);
datum
[
offset
]
=
PointerGetDatum
(
GetIndexValue
(
heapTuple
,
heapDescriptor
,
attOff
,
offset
,
attributeNumber
,
fInfo
,
&
isNull
));
nullv
[
attOff
]
=
(
isNull
)
?
'n'
:
' '
;
nullv
[
offset
]
=
(
isNull
)
?
'n'
:
' '
;
}
}
...
...
@@ -1417,10 +1424,10 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
newtup
=
heap_modifytuple
(
tuple
,
pg_class
,
values
,
nulls
,
replace
);
heap_replace
(
pg_class
,
&
tuple
->
t_ctid
,
newtup
);
pfree
(
newtup
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
pg_class
,
newtup
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
pfree
(
newtup
);
}
if
(
!
IsBootstrapProcessingMode
())
...
...
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