Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
04abb541
Commit
04abb541
authored
Sep 09, 1998
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for indexing problem (?): heap tuple was pfree-d before CatalogIndexInsert()...
parent
b5ed4be2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
src/backend/catalog/index.c
src/backend/catalog/index.c
+21
-14
No files found.
src/backend/catalog/index.c
View file @
04abb541
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
1 1998/09/07 05:35:37 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.6
2 1998/09/09 03:42:52 vadim
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -64,7 +64,8 @@
...
@@ -64,7 +64,8 @@
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
#define NTUPLES_PER_PAGE(natts) (BLCKSZ/((natts)*AVG_TUPLE_SIZE))
/* non-export function prototypes */
/* 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
Oid
GetHeapRelationOid
(
char
*
heapRelationName
,
char
*
indexRelationName
);
static
TupleDesc
BuildFuncTupleDesc
(
FuncIndexInfo
*
funcInfo
);
static
TupleDesc
BuildFuncTupleDesc
(
FuncIndexInfo
*
funcInfo
);
static
TupleDesc
ConstructTupleDescriptor
(
Oid
heapoid
,
Relation
heapRelation
,
static
TupleDesc
ConstructTupleDescriptor
(
Oid
heapoid
,
Relation
heapRelation
,
...
@@ -76,7 +77,8 @@ static Oid UpdateRelationRelation(Relation indexRelation);
...
@@ -76,7 +77,8 @@ static Oid UpdateRelationRelation(Relation indexRelation);
static
void
InitializeAttributeOids
(
Relation
indexRelation
,
static
void
InitializeAttributeOids
(
Relation
indexRelation
,
int
numatts
,
int
numatts
,
Oid
indexoid
);
Oid
indexoid
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
AppendAttributeTuples
(
Relation
indexRelation
,
int
numatts
);
static
void
UpdateIndexRelation
(
Oid
indexoid
,
Oid
heapoid
,
static
void
UpdateIndexRelation
(
Oid
indexoid
,
Oid
heapoid
,
FuncIndexInfo
*
funcInfo
,
int
natts
,
FuncIndexInfo
*
funcInfo
,
int
natts
,
AttrNumber
*
attNums
,
Oid
*
classOids
,
Node
*
predicate
,
AttrNumber
*
attNums
,
Oid
*
classOids
,
Node
*
predicate
,
...
@@ -550,9 +552,11 @@ UpdateRelationRelation(Relation indexRelation)
...
@@ -550,9 +552,11 @@ UpdateRelationRelation(Relation indexRelation)
sizeof
(
*
indexRelation
->
rd_rel
),
sizeof
(
*
indexRelation
->
rd_rel
),
(
char
*
)
indexRelation
->
rd_rel
);
(
char
*
)
indexRelation
->
rd_rel
);
/*
/* ----------------
* The new tuple must have the same oid as the heap_create() we just
* the new tuple must have the same oid as the relcache entry for the
* did.
* index. sure would be embarassing to do this sort of thing in polite
* company.
* ----------------
*/
*/
tuple
->
t_oid
=
RelationGetRelid
(
indexRelation
);
tuple
->
t_oid
=
RelationGetRelid
(
indexRelation
);
heap_insert
(
pg_class
,
tuple
);
heap_insert
(
pg_class
,
tuple
);
...
@@ -1074,7 +1078,7 @@ index_create(char *heapRelationName,
...
@@ -1074,7 +1078,7 @@ index_create(char *heapRelationName,
/* ----------------
/* ----------------
* add index to catalogs
* add index to catalogs
* (
INSERT pg_class
tuple)
* (
append RELATION
tuple)
* ----------------
* ----------------
*/
*/
indexoid
=
UpdateRelationRelation
(
indexRelation
);
indexoid
=
UpdateRelationRelation
(
indexRelation
);
...
@@ -1260,7 +1264,8 @@ FormIndexDatum(int numberOfAttributes,
...
@@ -1260,7 +1264,8 @@ FormIndexDatum(int numberOfAttributes,
char
*
nullv
,
char
*
nullv
,
FuncIndexInfoPtr
fInfo
)
FuncIndexInfoPtr
fInfo
)
{
{
AttrNumber
attOff
;
AttrNumber
i
;
int
offset
;
bool
isNull
;
bool
isNull
;
/* ----------------
/* ----------------
...
@@ -1270,16 +1275,18 @@ FormIndexDatum(int numberOfAttributes,
...
@@ -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
,
heapDescriptor
,
attOff
,
offset
,
attributeNumber
,
attributeNumber
,
fInfo
,
fInfo
,
&
isNull
));
&
isNull
));
nullv
[
attOff
]
=
(
isNull
)
?
'n'
:
' '
;
nullv
[
offset
]
=
(
isNull
)
?
'n'
:
' '
;
}
}
}
}
...
@@ -1417,10 +1424,10 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
...
@@ -1417,10 +1424,10 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
newtup
=
heap_modifytuple
(
tuple
,
pg_class
,
values
,
nulls
,
replace
);
newtup
=
heap_modifytuple
(
tuple
,
pg_class
,
values
,
nulls
,
replace
);
heap_replace
(
pg_class
,
&
tuple
->
t_ctid
,
newtup
);
heap_replace
(
pg_class
,
&
tuple
->
t_ctid
,
newtup
);
pfree
(
newtup
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
pg_class
,
newtup
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
pg_class
,
newtup
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
pfree
(
newtup
);
}
}
if
(
!
IsBootstrapProcessingMode
())
if
(
!
IsBootstrapProcessingMode
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment