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
397e9b32
Commit
397e9b32
authored
Dec 16, 1999
by
Jan Wieck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some changes to prepare for LONG attributes.
Jan
parent
5ca971a1
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
235 additions
and
115 deletions
+235
-115
src/backend/access/common/heaptuple.c
src/backend/access/common/heaptuple.c
+26
-1
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam.c
+39
-1
src/backend/bootstrap/bootstrap.c
src/backend/bootstrap/bootstrap.c
+2
-2
src/backend/catalog/heap.c
src/backend/catalog/heap.c
+10
-10
src/backend/catalog/index.c
src/backend/catalog/index.c
+12
-12
src/backend/catalog/indexing.c
src/backend/catalog/indexing.c
+3
-2
src/backend/catalog/pg_operator.c
src/backend/catalog/pg_operator.c
+2
-2
src/backend/catalog/pg_type.c
src/backend/catalog/pg_type.c
+4
-4
src/backend/commands/async.c
src/backend/commands/async.c
+2
-2
src/backend/commands/cluster.c
src/backend/commands/cluster.c
+3
-1
src/backend/commands/command.c
src/backend/commands/command.c
+2
-2
src/backend/commands/comment.c
src/backend/commands/comment.c
+1
-1
src/backend/commands/copy.c
src/backend/commands/copy.c
+3
-3
src/backend/commands/creatinh.c
src/backend/commands/creatinh.c
+3
-3
src/backend/commands/indexcmds.c
src/backend/commands/indexcmds.c
+2
-2
src/backend/commands/proclang.c
src/backend/commands/proclang.c
+1
-1
src/backend/commands/remove.c
src/backend/commands/remove.c
+2
-2
src/backend/commands/rename.c
src/backend/commands/rename.c
+3
-3
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+10
-9
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+14
-3
src/backend/executor/_deadcode/nodeTee.c
src/backend/executor/_deadcode/nodeTee.c
+2
-2
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+8
-8
src/backend/executor/execTuples.c
src/backend/executor/execTuples.c
+3
-2
src/backend/executor/nodeGroup.c
src/backend/executor/nodeGroup.c
+5
-5
src/backend/executor/nodeHash.c
src/backend/executor/nodeHash.c
+2
-1
src/backend/executor/nodeHashjoin.c
src/backend/executor/nodeHashjoin.c
+2
-1
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeSubplan.c
+4
-4
src/backend/executor/nodeTidscan.c
src/backend/executor/nodeTidscan.c
+2
-1
src/backend/executor/spi.c
src/backend/executor/spi.c
+21
-1
src/backend/nodes/freefuncs.c
src/backend/nodes/freefuncs.c
+3
-3
src/backend/parser/parse_func.c
src/backend/parser/parse_func.c
+3
-1
src/backend/rewrite/rewriteRemove.c
src/backend/rewrite/rewriteRemove.c
+3
-3
src/backend/rewrite/rewriteSupport.c
src/backend/rewrite/rewriteSupport.c
+2
-2
src/backend/storage/large_object/inv_api.c
src/backend/storage/large_object/inv_api.c
+5
-3
src/backend/utils/adt/regproc.c
src/backend/utils/adt/regproc.c
+3
-1
src/backend/utils/cache/catcache.c
src/backend/utils/cache/catcache.c
+2
-2
src/backend/utils/cache/relcache.c
src/backend/utils/cache/relcache.c
+4
-2
src/backend/utils/misc/database.c
src/backend/utils/misc/database.c
+2
-1
src/backend/utils/sort/tuplesort.c
src/backend/utils/sort/tuplesort.c
+3
-2
src/include/access/heapam.h
src/include/access/heapam.h
+2
-1
src/include/access/htup.h
src/include/access/htup.h
+7
-1
src/include/executor/spi.h
src/include/executor/spi.h
+1
-0
src/test/regress/regress.c
src/test/regress/regress.c
+2
-2
No files found.
src/backend/access/common/heaptuple.c
View file @
397e9b32
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.5
8 1999/07/19 07:07:15 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.5
9 1999/12/16 22:19:34 wieck
Exp $
*
*
* NOTES
* NOTES
* The old interface functions have been converted to macros
* The old interface functions have been converted to macros
...
@@ -562,6 +562,7 @@ heap_copytuple(HeapTuple tuple)
...
@@ -562,6 +562,7 @@ heap_copytuple(HeapTuple tuple)
newTuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
tuple
->
t_len
);
newTuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
tuple
->
t_len
);
newTuple
->
t_len
=
tuple
->
t_len
;
newTuple
->
t_len
=
tuple
->
t_len
;
newTuple
->
t_self
=
tuple
->
t_self
;
newTuple
->
t_self
=
tuple
->
t_self
;
newTuple
->
t_datamcxt
=
CurrentMemoryContext
;
newTuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
newTuple
+
HEAPTUPLESIZE
);
newTuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
newTuple
+
HEAPTUPLESIZE
);
memmove
((
char
*
)
newTuple
->
t_data
,
memmove
((
char
*
)
newTuple
->
t_data
,
(
char
*
)
tuple
->
t_data
,
(
int
)
tuple
->
t_len
);
(
char
*
)
tuple
->
t_data
,
(
int
)
tuple
->
t_len
);
...
@@ -585,6 +586,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
...
@@ -585,6 +586,7 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
dest
->
t_len
=
src
->
t_len
;
dest
->
t_len
=
src
->
t_len
;
dest
->
t_self
=
src
->
t_self
;
dest
->
t_self
=
src
->
t_self
;
dest
->
t_datamcxt
=
CurrentMemoryContext
;
dest
->
t_data
=
(
HeapTupleHeader
)
palloc
(
src
->
t_len
);
dest
->
t_data
=
(
HeapTupleHeader
)
palloc
(
src
->
t_len
);
memmove
((
char
*
)
dest
->
t_data
,
memmove
((
char
*
)
dest
->
t_data
,
(
char
*
)
src
->
t_data
,
(
int
)
src
->
t_len
);
(
char
*
)
src
->
t_data
,
(
int
)
src
->
t_len
);
...
@@ -682,6 +684,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
...
@@ -682,6 +684,7 @@ heap_formtuple(TupleDesc tupleDescriptor,
len
+=
ComputeDataSize
(
tupleDescriptor
,
value
,
nulls
);
len
+=
ComputeDataSize
(
tupleDescriptor
,
value
,
nulls
);
tuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
len
);
tuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
len
);
tuple
->
t_datamcxt
=
CurrentMemoryContext
;
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
MemSet
((
char
*
)
td
,
0
,
(
int
)
len
);
MemSet
((
char
*
)
td
,
0
,
(
int
)
len
);
...
@@ -792,6 +795,27 @@ heap_modifytuple(HeapTuple tuple,
...
@@ -792,6 +795,27 @@ heap_modifytuple(HeapTuple tuple,
return
newTuple
;
return
newTuple
;
}
}
/* ----------------
* heap_freetuple
* ----------------
*/
void
heap_freetuple
(
HeapTuple
htup
)
{
extern
int
getpid
();
if
(
htup
->
t_data
!=
NULL
)
if
(
htup
->
t_datamcxt
!=
NULL
&&
(
char
*
)(
htup
->
t_data
)
!=
((
char
*
)
htup
+
HEAPTUPLESIZE
))
{
elog
(
NOTICE
,
"TELL Jan Wieck: heap_freetuple() found separate t_data"
);
}
pfree
(
htup
);
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
* other misc functions
* other misc functions
* ----------------------------------------------------------------
* ----------------------------------------------------------------
...
@@ -814,6 +838,7 @@ heap_addheader(uint32 natts, /* max domain index */
...
@@ -814,6 +838,7 @@ heap_addheader(uint32 natts, /* max domain index */
hoff
=
len
=
MAXALIGN
(
len
);
/* be conservative */
hoff
=
len
=
MAXALIGN
(
len
);
/* be conservative */
len
+=
structlen
;
len
+=
structlen
;
tuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
len
);
tuple
=
(
HeapTuple
)
palloc
(
HEAPTUPLESIZE
+
len
);
tuple
->
t_datamcxt
=
CurrentMemoryContext
;
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
td
=
tuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
tuple
+
HEAPTUPLESIZE
);
MemSet
((
char
*
)
td
,
0
,
(
int
)
len
);
MemSet
((
char
*
)
td
,
0
,
(
int
)
len
);
...
...
src/backend/access/heap/heapam.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.6
0 1999/11/24 00:44:28 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.6
1 1999/12/16 22:19:36 wieck
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -117,6 +117,8 @@ initscan(HeapScanDesc scan,
...
@@ -117,6 +117,8 @@ initscan(HeapScanDesc scan,
* relation is empty
* relation is empty
* ----------------
* ----------------
*/
*/
scan
->
rs_ntup
.
t_datamcxt
=
scan
->
rs_ctup
.
t_datamcxt
=
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
scan
->
rs_ctup
.
t_data
=
scan
->
rs_ntup
.
t_data
=
scan
->
rs_ctup
.
t_data
=
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
scan
->
rs_cbuf
=
scan
->
rs_pbuf
=
InvalidBuffer
;
scan
->
rs_nbuf
=
scan
->
rs_cbuf
=
scan
->
rs_pbuf
=
InvalidBuffer
;
...
@@ -127,8 +129,10 @@ initscan(HeapScanDesc scan,
...
@@ -127,8 +129,10 @@ initscan(HeapScanDesc scan,
* reverse scan
* reverse scan
* ----------------
* ----------------
*/
*/
scan
->
rs_ntup
.
t_datamcxt
=
scan
->
rs_ctup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
scan
->
rs_ctup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
scan
->
rs_ctup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
scan
->
rs_cbuf
=
InvalidBuffer
;
scan
->
rs_nbuf
=
scan
->
rs_cbuf
=
InvalidBuffer
;
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_pbuf
=
UnknownBuffer
;
scan
->
rs_pbuf
=
UnknownBuffer
;
}
}
...
@@ -138,8 +142,10 @@ initscan(HeapScanDesc scan,
...
@@ -138,8 +142,10 @@ initscan(HeapScanDesc scan,
* forward scan
* forward scan
* ----------------
* ----------------
*/
*/
scan
->
rs_ctup
.
t_datamcxt
=
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ctup
.
t_data
=
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ctup
.
t_data
=
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_cbuf
=
scan
->
rs_pbuf
=
InvalidBuffer
;
scan
->
rs_cbuf
=
scan
->
rs_pbuf
=
InvalidBuffer
;
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
UnknownBuffer
;
scan
->
rs_nbuf
=
UnknownBuffer
;
}
/* invalid too */
}
/* invalid too */
...
@@ -272,6 +278,7 @@ heapgettup(Relation relation,
...
@@ -272,6 +278,7 @@ heapgettup(Relation relation,
*/
*/
if
(
!
(
pages
=
relation
->
rd_nblocks
))
if
(
!
(
pages
=
relation
->
rd_nblocks
))
{
{
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
...
@@ -290,6 +297,7 @@ heapgettup(Relation relation,
...
@@ -290,6 +297,7 @@ heapgettup(Relation relation,
if
(
ItemPointerIsValid
(
tid
)
==
false
)
if
(
ItemPointerIsValid
(
tid
)
==
false
)
{
{
*
buffer
=
InvalidBuffer
;
*
buffer
=
InvalidBuffer
;
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
...
@@ -306,6 +314,7 @@ heapgettup(Relation relation,
...
@@ -306,6 +314,7 @@ heapgettup(Relation relation,
lineoff
=
ItemPointerGetOffsetNumber
(
tid
);
lineoff
=
ItemPointerGetOffsetNumber
(
tid
);
lpp
=
PageGetItemId
(
dp
,
lineoff
);
lpp
=
PageGetItemId
(
dp
,
lineoff
);
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lpp
);
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lpp
);
tuple
->
t_len
=
ItemIdGetLength
(
lpp
);
tuple
->
t_len
=
ItemIdGetLength
(
lpp
);
LockBuffer
(
*
buffer
,
BUFFER_LOCK_UNLOCK
);
LockBuffer
(
*
buffer
,
BUFFER_LOCK_UNLOCK
);
...
@@ -376,6 +385,7 @@ heapgettup(Relation relation,
...
@@ -376,6 +385,7 @@ heapgettup(Relation relation,
if
(
page
>=
pages
)
if
(
page
>=
pages
)
{
{
*
buffer
=
InvalidBuffer
;
*
buffer
=
InvalidBuffer
;
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
...
@@ -415,6 +425,7 @@ heapgettup(Relation relation,
...
@@ -415,6 +425,7 @@ heapgettup(Relation relation,
{
{
if
(
ItemIdIsUsed
(
lpp
))
if
(
ItemIdIsUsed
(
lpp
))
{
{
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lpp
);
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lpp
);
tuple
->
t_len
=
ItemIdGetLength
(
lpp
);
tuple
->
t_len
=
ItemIdGetLength
(
lpp
);
ItemPointerSet
(
&
(
tuple
->
t_self
),
page
,
lineoff
);
ItemPointerSet
(
&
(
tuple
->
t_self
),
page
,
lineoff
);
...
@@ -466,6 +477,7 @@ heapgettup(Relation relation,
...
@@ -466,6 +477,7 @@ heapgettup(Relation relation,
if
(
BufferIsValid
(
*
buffer
))
if
(
BufferIsValid
(
*
buffer
))
ReleaseBuffer
(
*
buffer
);
ReleaseBuffer
(
*
buffer
);
*
buffer
=
InvalidBuffer
;
*
buffer
=
InvalidBuffer
;
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
...
@@ -836,6 +848,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -836,6 +848,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
{
{
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
ReleaseBuffer
(
scan
->
rs_nbuf
);
ReleaseBuffer
(
scan
->
rs_nbuf
);
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
UnknownBuffer
;
scan
->
rs_nbuf
=
UnknownBuffer
;
return
NULL
;
return
NULL
;
...
@@ -892,10 +905,12 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -892,10 +905,12 @@ heap_getnext(HeapScanDesc scandesc, int backw)
{
{
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
ReleaseBuffer
(
scan
->
rs_pbuf
);
ReleaseBuffer
(
scan
->
rs_pbuf
);
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_pbuf
=
InvalidBuffer
;
scan
->
rs_pbuf
=
InvalidBuffer
;
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
ReleaseBuffer
(
scan
->
rs_nbuf
);
ReleaseBuffer
(
scan
->
rs_nbuf
);
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
InvalidBuffer
;
scan
->
rs_nbuf
=
InvalidBuffer
;
return
NULL
;
return
NULL
;
...
@@ -903,6 +918,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -903,6 +918,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
ReleaseBuffer
(
scan
->
rs_pbuf
);
ReleaseBuffer
(
scan
->
rs_pbuf
);
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_pbuf
=
UnknownBuffer
;
scan
->
rs_pbuf
=
UnknownBuffer
;
...
@@ -918,6 +934,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -918,6 +934,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
{
{
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
ReleaseBuffer
(
scan
->
rs_pbuf
);
ReleaseBuffer
(
scan
->
rs_pbuf
);
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_pbuf
=
UnknownBuffer
;
scan
->
rs_pbuf
=
UnknownBuffer
;
HEAPDEBUG_3
;
/* heap_getnext returns NULL at end */
HEAPDEBUG_3
;
/* heap_getnext returns NULL at end */
...
@@ -976,10 +993,12 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -976,10 +993,12 @@ heap_getnext(HeapScanDesc scandesc, int backw)
{
{
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
ReleaseBuffer
(
scan
->
rs_nbuf
);
ReleaseBuffer
(
scan
->
rs_nbuf
);
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
InvalidBuffer
;
scan
->
rs_nbuf
=
InvalidBuffer
;
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
if
(
BufferIsValid
(
scan
->
rs_pbuf
))
ReleaseBuffer
(
scan
->
rs_pbuf
);
ReleaseBuffer
(
scan
->
rs_pbuf
);
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_pbuf
=
InvalidBuffer
;
scan
->
rs_pbuf
=
InvalidBuffer
;
HEAPDEBUG_6
;
/* heap_getnext returning EOS */
HEAPDEBUG_6
;
/* heap_getnext returning EOS */
...
@@ -988,6 +1007,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
...
@@ -988,6 +1007,7 @@ heap_getnext(HeapScanDesc scandesc, int backw)
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
if
(
BufferIsValid
(
scan
->
rs_nbuf
))
ReleaseBuffer
(
scan
->
rs_nbuf
);
ReleaseBuffer
(
scan
->
rs_nbuf
);
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_nbuf
=
UnknownBuffer
;
scan
->
rs_nbuf
=
UnknownBuffer
;
}
}
...
@@ -1066,10 +1086,12 @@ heap_fetch(Relation relation,
...
@@ -1066,10 +1086,12 @@ heap_fetch(Relation relation,
{
{
ReleaseBuffer
(
buffer
);
ReleaseBuffer
(
buffer
);
*
userbuf
=
InvalidBuffer
;
*
userbuf
=
InvalidBuffer
;
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
->
t_len
=
ItemIdGetLength
(
lp
);
tuple
->
t_len
=
ItemIdGetLength
(
lp
);
...
@@ -1156,6 +1178,7 @@ heap_get_latest_tid(Relation relation,
...
@@ -1156,6 +1178,7 @@ heap_get_latest_tid(Relation relation,
* ----------------
* ----------------
*/
*/
tp
.
t_datamcxt
=
NULL
;
t_data
=
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
t_data
=
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tp
.
t_len
=
ItemIdGetLength
(
lp
);
tp
.
t_len
=
ItemIdGetLength
(
lp
);
tp
.
t_self
=
*
tid
;
tp
.
t_self
=
*
tid
;
...
@@ -1270,6 +1293,7 @@ heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid)
...
@@ -1270,6 +1293,7 @@ heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid)
dp
=
(
PageHeader
)
BufferGetPage
(
buffer
);
dp
=
(
PageHeader
)
BufferGetPage
(
buffer
);
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
tid
));
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
tid
));
tp
.
t_datamcxt
=
NULL
;
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tp
.
t_len
=
ItemIdGetLength
(
lp
);
tp
.
t_len
=
ItemIdGetLength
(
lp
);
tp
.
t_self
=
*
tid
;
tp
.
t_self
=
*
tid
;
...
@@ -1365,6 +1389,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
...
@@ -1365,6 +1389,7 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
dp
=
(
PageHeader
)
BufferGetPage
(
buffer
);
dp
=
(
PageHeader
)
BufferGetPage
(
buffer
);
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
otid
));
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
otid
));
oldtup
.
t_datamcxt
=
NULL
;
oldtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
dp
,
lp
);
oldtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
dp
,
lp
);
oldtup
.
t_len
=
ItemIdGetLength
(
lp
);
oldtup
.
t_len
=
ItemIdGetLength
(
lp
);
oldtup
.
t_self
=
*
otid
;
oldtup
.
t_self
=
*
otid
;
...
@@ -1488,6 +1513,7 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer)
...
@@ -1488,6 +1513,7 @@ heap_mark4update(Relation relation, HeapTuple tuple, Buffer *buffer)
dp
=
(
PageHeader
)
BufferGetPage
(
*
buffer
);
dp
=
(
PageHeader
)
BufferGetPage
(
*
buffer
);
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
tid
));
lp
=
PageGetItemId
(
dp
,
ItemPointerGetOffsetNumber
(
tid
));
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
->
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
->
t_len
=
ItemIdGetLength
(
lp
);
tuple
->
t_len
=
ItemIdGetLength
(
lp
);
...
@@ -1665,10 +1691,14 @@ heap_restrpos(HeapScanDesc scan)
...
@@ -1665,10 +1691,14 @@ heap_restrpos(HeapScanDesc scan)
scan
->
rs_nbuf
=
InvalidBuffer
;
scan
->
rs_nbuf
=
InvalidBuffer
;
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mptid
))
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mptid
))
{
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
scan
->
rs_ptup
.
t_data
=
NULL
;
}
else
else
{
{
scan
->
rs_ptup
.
t_self
=
scan
->
rs_mptid
;
scan
->
rs_ptup
.
t_self
=
scan
->
rs_mptid
;
scan
->
rs_ptup
.
t_datamcxt
=
NULL
;
scan
->
rs_ptup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
scan
->
rs_ptup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
heapgettup
(
scan
->
rs_rd
,
heapgettup
(
scan
->
rs_rd
,
&
(
scan
->
rs_ptup
),
&
(
scan
->
rs_ptup
),
...
@@ -1680,10 +1710,14 @@ heap_restrpos(HeapScanDesc scan)
...
@@ -1680,10 +1710,14 @@ heap_restrpos(HeapScanDesc scan)
}
}
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mctid
))
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mctid
))
{
scan
->
rs_ctup
.
t_datamcxt
=
NULL
;
scan
->
rs_ctup
.
t_data
=
NULL
;
scan
->
rs_ctup
.
t_data
=
NULL
;
}
else
else
{
{
scan
->
rs_ctup
.
t_self
=
scan
->
rs_mctid
;
scan
->
rs_ctup
.
t_self
=
scan
->
rs_mctid
;
scan
->
rs_ctup
.
t_datamcxt
=
NULL
;
scan
->
rs_ctup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
scan
->
rs_ctup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
heapgettup
(
scan
->
rs_rd
,
heapgettup
(
scan
->
rs_rd
,
&
(
scan
->
rs_ctup
),
&
(
scan
->
rs_ctup
),
...
@@ -1695,9 +1729,13 @@ heap_restrpos(HeapScanDesc scan)
...
@@ -1695,9 +1729,13 @@ heap_restrpos(HeapScanDesc scan)
}
}
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mntid
))
if
(
!
ItemPointerIsValid
(
&
scan
->
rs_mntid
))
{
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
scan
->
rs_ntup
.
t_data
=
NULL
;
}
else
else
{
{
scan
->
rs_ntup
.
t_datamcxt
=
NULL
;
scan
->
rs_ntup
.
t_self
=
scan
->
rs_mntid
;
scan
->
rs_ntup
.
t_self
=
scan
->
rs_mntid
;
scan
->
rs_ntup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
scan
->
rs_ntup
.
t_data
=
(
HeapTupleHeader
)
0x1
;
/* for heapgettup */
heapgettup
(
scan
->
rs_rd
,
heapgettup
(
scan
->
rs_rd
,
...
...
src/backend/bootstrap/bootstrap.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.7
2 1999/11/24 00:58:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.7
3 1999/12/16 22:19:37 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -628,7 +628,7 @@ InsertOneTuple(Oid objectid)
...
@@ -628,7 +628,7 @@ InsertOneTuple(Oid objectid)
if
(
objectid
!=
(
Oid
)
0
)
if
(
objectid
!=
(
Oid
)
0
)
tuple
->
t_data
->
t_oid
=
objectid
;
tuple
->
t_data
->
t_oid
=
objectid
;
heap_insert
(
reldesc
,
tuple
);
heap_insert
(
reldesc
,
tuple
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
if
(
DebugMode
)
if
(
DebugMode
)
{
{
printf
(
"End InsertOneTuple, objectid=%u
\n
"
,
objectid
);
printf
(
"End InsertOneTuple, objectid=%u
\n
"
,
objectid
);
...
...
src/backend/catalog/heap.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.11
2 1999/12/10 03:55:47 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.11
3 1999/12/16 22:19:38 wieck
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -608,7 +608,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
...
@@ -608,7 +608,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
if
(
hasindex
)
if
(
hasindex
)
CatalogIndexInsert
(
idescs
,
Num_pg_attr_indices
,
rel
,
tup
);
CatalogIndexInsert
(
idescs
,
Num_pg_attr_indices
,
rel
,
tup
);
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
dpp
++
;
dpp
++
;
}
}
...
@@ -631,7 +631,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
...
@@ -631,7 +631,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
if
(
hasindex
)
if
(
hasindex
)
CatalogIndexInsert
(
idescs
,
Num_pg_attr_indices
,
rel
,
tup
);
CatalogIndexInsert
(
idescs
,
Num_pg_attr_indices
,
rel
,
tup
);
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
dpp
++
;
dpp
++
;
}
}
...
@@ -727,7 +727,7 @@ AddNewRelationTuple(Relation pg_class_desc,
...
@@ -727,7 +727,7 @@ AddNewRelationTuple(Relation pg_class_desc,
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
}
}
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
}
}
...
@@ -1084,7 +1084,7 @@ DeleteRelationTuple(Relation rel)
...
@@ -1084,7 +1084,7 @@ DeleteRelationTuple(Relation rel)
* ----------------
* ----------------
*/
*/
heap_delete
(
pg_class_desc
,
&
tup
->
t_self
,
NULL
);
heap_delete
(
pg_class_desc
,
&
tup
->
t_self
,
NULL
);
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
heap_close
(
pg_class_desc
,
RowExclusiveLock
);
heap_close
(
pg_class_desc
,
RowExclusiveLock
);
}
}
...
@@ -1314,7 +1314,7 @@ DeleteAttributeTuples(Relation rel)
...
@@ -1314,7 +1314,7 @@ DeleteAttributeTuples(Relation rel)
DeleteComments
(
tup
->
t_data
->
t_oid
);
DeleteComments
(
tup
->
t_data
->
t_oid
);
heap_delete
(
pg_attribute_desc
,
&
tup
->
t_self
,
NULL
);
heap_delete
(
pg_attribute_desc
,
&
tup
->
t_self
,
NULL
);
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
}
}
}
}
...
@@ -1753,7 +1753,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
...
@@ -1753,7 +1753,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
pfree
(
DatumGetPointer
(
values
[
Anum_pg_attrdef_adbin
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_attrdef_adbin
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_attrdef_adsrc
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_attrdef_adsrc
-
1
]));
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
pfree
(
adsrc
);
pfree
(
adsrc
);
if
(
!
updatePgAttribute
)
if
(
!
updatePgAttribute
)
...
@@ -1778,7 +1778,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
...
@@ -1778,7 +1778,7 @@ StoreAttrDefault(Relation rel, AttrNumber attnum, char *adbin,
CatalogCloseIndices
(
Num_pg_attr_indices
,
attridescs
);
CatalogCloseIndices
(
Num_pg_attr_indices
,
attridescs
);
}
}
heap_close
(
attrrel
,
RowExclusiveLock
);
heap_close
(
attrrel
,
RowExclusiveLock
);
pfre
e
(
atttup
);
heap_freetupl
e
(
atttup
);
}
}
/*
/*
...
@@ -1833,7 +1833,7 @@ StoreRelCheck(Relation rel, char *ccname, char *ccbin)
...
@@ -1833,7 +1833,7 @@ StoreRelCheck(Relation rel, char *ccname, char *ccbin)
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcname
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcname
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcbin
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcbin
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcsrc
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_relcheck_rcsrc
-
1
]));
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
pfree
(
ccsrc
);
pfree
(
ccsrc
);
}
}
...
@@ -2101,7 +2101,7 @@ AddRelationRawConstraints(Relation rel,
...
@@ -2101,7 +2101,7 @@ AddRelationRawConstraints(Relation rel,
CatalogCloseIndices
(
Num_pg_class_indices
,
relidescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
relidescs
);
heap_close
(
relrel
,
RowExclusiveLock
);
heap_close
(
relrel
,
RowExclusiveLock
);
pfre
e
(
reltup
);
heap_freetupl
e
(
reltup
);
/*
/*
* Force rebuild of our own relcache entry, otherwise subsequent commands
* Force rebuild of our own relcache entry, otherwise subsequent commands
...
...
src/backend/catalog/index.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
99 1999/12/10 03:55:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.
100 1999/12/16 22:19:39 wieck
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -489,7 +489,7 @@ UpdateRelationRelation(Relation indexRelation, char *temp_relname)
...
@@ -489,7 +489,7 @@ UpdateRelationRelation(Relation indexRelation, char *temp_relname)
}
}
tupleOid
=
tuple
->
t_data
->
t_oid
;
tupleOid
=
tuple
->
t_data
->
t_oid
;
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
pg_class
,
RowExclusiveLock
);
heap_close
(
pg_class
,
RowExclusiveLock
);
return
tupleOid
;
return
tupleOid
;
...
@@ -581,7 +581,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
...
@@ -581,7 +581,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
value
,
value
,
nullv
,
nullv
,
replace
);
replace
);
pfre
e
(
init_tuple
);
heap_freetupl
e
(
init_tuple
);
heap_insert
(
pg_attribute
,
cur_tuple
);
heap_insert
(
pg_attribute
,
cur_tuple
);
if
(
hasind
)
if
(
hasind
)
...
@@ -611,7 +611,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
...
@@ -611,7 +611,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
value
,
value
,
nullv
,
nullv
,
replace
);
replace
);
pfre
e
(
cur_tuple
);
heap_freetupl
e
(
cur_tuple
);
heap_insert
(
pg_attribute
,
new_tuple
);
heap_insert
(
pg_attribute
,
new_tuple
);
if
(
hasind
)
if
(
hasind
)
...
@@ -626,7 +626,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
...
@@ -626,7 +626,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
}
}
if
(
cur_tuple
)
if
(
cur_tuple
)
pfre
e
(
cur_tuple
);
heap_freetupl
e
(
cur_tuple
);
heap_close
(
pg_attribute
,
RowExclusiveLock
);
heap_close
(
pg_attribute
,
RowExclusiveLock
);
if
(
hasind
)
if
(
hasind
)
CatalogCloseIndices
(
Num_pg_attr_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_attr_indices
,
idescs
);
...
@@ -768,7 +768,7 @@ UpdateIndexRelation(Oid indexoid,
...
@@ -768,7 +768,7 @@ UpdateIndexRelation(Oid indexoid,
heap_close
(
pg_index
,
RowExclusiveLock
);
heap_close
(
pg_index
,
RowExclusiveLock
);
pfree
(
predText
);
pfree
(
predText
);
pfree
(
indexForm
);
pfree
(
indexForm
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
}
}
/* ----------------------------------------------------------------
/* ----------------------------------------------------------------
...
@@ -841,7 +841,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
...
@@ -841,7 +841,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
heap_update
(
pg_index
,
&
newtup
->
t_self
,
newtup
,
NULL
);
heap_update
(
pg_index
,
&
newtup
->
t_self
,
newtup
,
NULL
);
pfre
e
(
newtup
);
heap_freetupl
e
(
newtup
);
heap_close
(
pg_index
,
RowExclusiveLock
);
heap_close
(
pg_index
,
RowExclusiveLock
);
pfree
(
predText
);
pfree
(
predText
);
}
}
...
@@ -1170,7 +1170,7 @@ index_drop(Oid indexId)
...
@@ -1170,7 +1170,7 @@ index_drop(Oid indexId)
Assert
(
HeapTupleIsValid
(
tuple
));
Assert
(
HeapTupleIsValid
(
tuple
));
heap_delete
(
relationRelation
,
&
tuple
->
t_self
,
NULL
);
heap_delete
(
relationRelation
,
&
tuple
->
t_self
,
NULL
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
relationRelation
,
RowExclusiveLock
);
heap_close
(
relationRelation
,
RowExclusiveLock
);
/* ----------------
/* ----------------
...
@@ -1187,7 +1187,7 @@ index_drop(Oid indexId)
...
@@ -1187,7 +1187,7 @@ index_drop(Oid indexId)
0
,
0
)))
0
,
0
)))
{
{
heap_delete
(
attributeRelation
,
&
tuple
->
t_self
,
NULL
);
heap_delete
(
attributeRelation
,
&
tuple
->
t_self
,
NULL
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
attnum
++
;
attnum
++
;
}
}
heap_close
(
attributeRelation
,
RowExclusiveLock
);
heap_close
(
attributeRelation
,
RowExclusiveLock
);
...
@@ -1204,7 +1204,7 @@ index_drop(Oid indexId)
...
@@ -1204,7 +1204,7 @@ index_drop(Oid indexId)
Assert
(
HeapTupleIsValid
(
tuple
));
Assert
(
HeapTupleIsValid
(
tuple
));
heap_delete
(
indexRelation
,
&
tuple
->
t_self
,
NULL
);
heap_delete
(
indexRelation
,
&
tuple
->
t_self
,
NULL
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
indexRelation
,
RowExclusiveLock
);
heap_close
(
indexRelation
,
RowExclusiveLock
);
/*
/*
...
@@ -1433,11 +1433,11 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
...
@@ -1433,11 +1433,11 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
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
);
pfre
e
(
newtup
);
heap_freetupl
e
(
newtup
);
}
}
if
(
!
IsBootstrapProcessingMode
())
if
(
!
IsBootstrapProcessingMode
())
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
else
else
heap_endscan
(
pg_class_scan
);
heap_endscan
(
pg_class_scan
);
...
...
src/backend/catalog/indexing.c
View file @
397e9b32
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
3 1999/11/25 00:15:56 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.5
4 1999/12/16 22:19:39 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -178,7 +178,7 @@ CatalogIndexInsert(Relation *idescs,
...
@@ -178,7 +178,7 @@ CatalogIndexInsert(Relation *idescs,
if
(
indexRes
)
if
(
indexRes
)
pfree
(
indexRes
);
pfree
(
indexRes
);
pfre
e
(
index_tup
);
heap_freetupl
e
(
index_tup
);
}
}
}
}
...
@@ -248,6 +248,7 @@ CatalogIndexFetchTuple(Relation heapRelation,
...
@@ -248,6 +248,7 @@ CatalogIndexFetchTuple(Relation heapRelation,
Buffer
buffer
;
Buffer
buffer
;
sd
=
index_beginscan
(
idesc
,
false
,
num_keys
,
skey
);
sd
=
index_beginscan
(
idesc
,
false
,
num_keys
,
skey
);
tuple
.
t_datamcxt
=
CurrentMemoryContext
;
tuple
.
t_data
=
NULL
;
tuple
.
t_data
=
NULL
;
while
((
indexRes
=
index_getnext
(
sd
,
ForwardScanDirection
)))
while
((
indexRes
=
index_getnext
(
sd
,
ForwardScanDirection
)))
{
{
...
...
src/backend/catalog/pg_operator.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.4
4 1999/11/24 00:44:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.4
5 1999/12/16 22:19:39 wieck
Exp $
*
*
* NOTES
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
* these routines moved here from commands/define.c and somewhat cleaned up.
...
@@ -306,7 +306,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
...
@@ -306,7 +306,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
* free the tuple and return the operator oid
* free the tuple and return the operator oid
* ----------------
* ----------------
*/
*/
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
return
operatorObjectId
;
return
operatorObjectId
;
}
}
...
...
src/backend/catalog/pg_type.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.4
3 1999/11/24 00:44:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.4
4 1999/12/16 22:19:39 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -218,7 +218,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
...
@@ -218,7 +218,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
* free the tuple and return the type-oid
* free the tuple and return the type-oid
* ----------------
* ----------------
*/
*/
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
return
typoid
;
return
typoid
;
}
}
...
@@ -551,7 +551,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
...
@@ -551,7 +551,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
0
,
0
,
0
);
0
,
0
,
0
);
if
(
HeapTupleIsValid
(
newtup
))
if
(
HeapTupleIsValid
(
newtup
))
{
{
pfre
e
(
oldtup
);
heap_freetupl
e
(
oldtup
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
elog
(
ERROR
,
"TypeRename: type %s already defined"
,
newTypeName
);
elog
(
ERROR
,
"TypeRename: type %s already defined"
,
newTypeName
);
}
}
...
@@ -567,7 +567,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
...
@@ -567,7 +567,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
CatalogIndexInsert
(
idescs
,
Num_pg_type_indices
,
pg_type_desc
,
oldtup
);
CatalogIndexInsert
(
idescs
,
Num_pg_type_indices
,
pg_type_desc
,
oldtup
);
CatalogCloseIndices
(
Num_pg_type_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_type_indices
,
idescs
);
pfre
e
(
oldtup
);
heap_freetupl
e
(
oldtup
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
heap_close
(
pg_type_desc
,
RowExclusiveLock
);
}
}
...
...
src/backend/commands/async.c
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.5
6 1999/11/24 00:44:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.5
7 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -247,7 +247,7 @@ Async_Listen(char *relname, int pid)
...
@@ -247,7 +247,7 @@ Async_Listen(char *relname, int pid)
tupDesc
=
lRel
->
rd_att
;
tupDesc
=
lRel
->
rd_att
;
newtup
=
heap_formtuple
(
tupDesc
,
values
,
nulls
);
newtup
=
heap_formtuple
(
tupDesc
,
values
,
nulls
);
heap_insert
(
lRel
,
newtup
);
heap_insert
(
lRel
,
newtup
);
pfre
e
(
newtup
);
heap_freetupl
e
(
newtup
);
heap_close
(
lRel
,
AccessExclusiveLock
);
heap_close
(
lRel
,
AccessExclusiveLock
);
...
...
src/backend/commands/cluster.c
View file @
397e9b32
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.4
8 1999/12/10 03:55:49 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/cluster.c,v 1.4
9 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -328,6 +328,8 @@ rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
...
@@ -328,6 +328,8 @@ rebuildheap(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex)
{
{
LocalHeapTuple
.
t_self
=
ScanResult
->
heap_iptr
;
LocalHeapTuple
.
t_self
=
ScanResult
->
heap_iptr
;
LocalHeapTuple
.
t_datamcxt
=
NULL
;
LocalHeapTuple
.
t_data
=
NULL
;
heap_fetch
(
LocalOldHeap
,
SnapshotNow
,
&
LocalHeapTuple
,
&
LocalBuffer
);
heap_fetch
(
LocalOldHeap
,
SnapshotNow
,
&
LocalHeapTuple
,
&
LocalBuffer
);
OIDNewHeapInsert
=
heap_insert
(
LocalNewHeap
,
&
LocalHeapTuple
);
OIDNewHeapInsert
=
heap_insert
(
LocalNewHeap
,
&
LocalHeapTuple
);
pfree
(
ScanResult
);
pfree
(
ScanResult
);
...
...
src/backend/commands/command.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.6
0 1999/12/14 03:35:20 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.6
1 1999/12/16 22:19:41 wieck
Exp $
*
*
* NOTES
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
* The PortalExecutorHeapMemory crap needs to be eliminated
...
@@ -481,7 +481,7 @@ PerformAddAttribute(char *relationName,
...
@@ -481,7 +481,7 @@ PerformAddAttribute(char *relationName,
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
rel
,
reltup
);
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
rel
,
reltup
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
pfre
e
(
reltup
);
heap_freetupl
e
(
reltup
);
heap_close
(
rel
,
RowExclusiveLock
);
heap_close
(
rel
,
RowExclusiveLock
);
}
}
...
...
src/backend/commands/comment.c
View file @
397e9b32
...
@@ -190,7 +190,7 @@ void CreateComments(Oid oid, char *comment) {
...
@@ -190,7 +190,7 @@ void CreateComments(Oid oid, char *comment) {
desctuple
);
desctuple
);
CatalogCloseIndices
(
Num_pg_description_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_description_indices
,
idescs
);
}
}
pfre
e
(
desctuple
);
heap_freetupl
e
(
desctuple
);
}
}
...
...
src/backend/commands/copy.c
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.9
3 1999/12/14 00:08:13 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.9
4 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -837,7 +837,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null
...
@@ -837,7 +837,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null
skip_tuple
=
true
;
skip_tuple
=
true
;
else
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
else
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
{
{
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
tuple
=
newtuple
;
tuple
=
newtuple
;
}
}
}
}
...
@@ -905,7 +905,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null
...
@@ -905,7 +905,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim, char *null
nulls
[
i
]
=
' '
;
nulls
[
i
]
=
' '
;
}
}
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
tuples_read
++
;
tuples_read
++
;
if
(
!
reading_to_eof
&&
ntuples
==
tuples_read
)
if
(
!
reading_to_eof
&&
ntuples
==
tuples_read
)
...
...
src/backend/commands/creatinh.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.5
3 1999/12/10 03:55:49 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.5
4 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -505,7 +505,7 @@ StoreCatalogInheritance(Oid relationId, List *supers)
...
@@ -505,7 +505,7 @@ StoreCatalogInheritance(Oid relationId, List *supers)
CatalogCloseIndices
(
Num_pg_inherits_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_inherits_indices
,
idescs
);
}
}
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
seqNumber
+=
1
;
seqNumber
+=
1
;
}
}
...
@@ -620,7 +620,7 @@ again:
...
@@ -620,7 +620,7 @@ again:
tuple
=
heap_formtuple
(
desc
,
datum
,
nullarr
);
tuple
=
heap_formtuple
(
desc
,
datum
,
nullarr
);
heap_insert
(
relation
,
tuple
);
heap_insert
(
relation
,
tuple
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
seqNumber
+=
1
;
seqNumber
+=
1
;
}
}
...
...
src/backend/commands/indexcmds.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1
5 1999/12/10 03:55:49 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.1
6 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -518,7 +518,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
...
@@ -518,7 +518,7 @@ NormIndexAttrs(List *attList, /* list of IndexElem's */
attribute
->
class
);
attribute
->
class
);
}
}
*
classOidP
++
=
tuple
->
t_data
->
t_oid
;
*
classOidP
++
=
tuple
->
t_data
->
t_oid
;
pfre
e
(
atttuple
);
heap_freetupl
e
(
atttuple
);
}
}
}
}
...
...
src/backend/commands/proclang.c
View file @
397e9b32
...
@@ -183,6 +183,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
...
@@ -183,6 +183,6 @@ DropProceduralLanguage(DropPLangStmt *stmt)
heap_delete
(
rel
,
&
langTup
->
t_self
,
NULL
);
heap_delete
(
rel
,
&
langTup
->
t_self
,
NULL
);
pfre
e
(
langTup
);
heap_freetupl
e
(
langTup
);
heap_close
(
rel
,
RowExclusiveLock
);
heap_close
(
rel
,
RowExclusiveLock
);
}
}
src/backend/commands/remove.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.4
1 1999/12/10 03:55:49 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.4
2 1999/12/16 22:19:41 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -125,7 +125,7 @@ RemoveOperator(char *operatorName, /* operator name */
...
@@ -125,7 +125,7 @@ RemoveOperator(char *operatorName, /* operator name */
typeName2
);
typeName2
);
}
}
}
}
pfre
e
(
tup
);
heap_freetupl
e
(
tup
);
heap_close
(
relation
,
RowExclusiveLock
);
heap_close
(
relation
,
RowExclusiveLock
);
}
}
...
...
src/backend/commands/rename.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.3
8 1999/12/14 03:35:20 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.3
9 1999/12/16 22:19:42 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -147,7 +147,7 @@ renameatt(char *relname,
...
@@ -147,7 +147,7 @@ renameatt(char *relname,
/* should not already exist */
/* should not already exist */
if
(
HeapTupleIsValid
(
newatttup
))
if
(
HeapTupleIsValid
(
newatttup
))
{
{
pfre
e
(
oldatttup
);
heap_freetupl
e
(
oldatttup
);
elog
(
ERROR
,
"renameatt: attribute
\"
%s
\"
exists"
,
newattname
);
elog
(
ERROR
,
"renameatt: attribute
\"
%s
\"
exists"
,
newattname
);
}
}
...
@@ -164,7 +164,7 @@ renameatt(char *relname,
...
@@ -164,7 +164,7 @@ renameatt(char *relname,
CatalogCloseIndices
(
Num_pg_attr_indices
,
irelations
);
CatalogCloseIndices
(
Num_pg_attr_indices
,
irelations
);
}
}
pfre
e
(
oldatttup
);
heap_freetupl
e
(
oldatttup
);
heap_close
(
attrelation
,
RowExclusiveLock
);
heap_close
(
attrelation
,
RowExclusiveLock
);
}
}
...
...
src/backend/commands/trigger.c
View file @
397e9b32
...
@@ -235,7 +235,7 @@ CreateTrigger(CreateTrigStmt *stmt)
...
@@ -235,7 +235,7 @@ CreateTrigger(CreateTrigStmt *stmt)
CatalogOpenIndices
(
Num_pg_trigger_indices
,
Name_pg_trigger_indices
,
idescs
);
CatalogOpenIndices
(
Num_pg_trigger_indices
,
Name_pg_trigger_indices
,
idescs
);
CatalogIndexInsert
(
idescs
,
Num_pg_trigger_indices
,
tgrel
,
tuple
);
CatalogIndexInsert
(
idescs
,
Num_pg_trigger_indices
,
tgrel
,
tuple
);
CatalogCloseIndices
(
Num_pg_trigger_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_trigger_indices
,
idescs
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
tgrel
,
RowExclusiveLock
);
heap_close
(
tgrel
,
RowExclusiveLock
);
pfree
(
DatumGetPointer
(
values
[
Anum_pg_trigger_tgname
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_trigger_tgname
-
1
]));
...
@@ -255,7 +255,7 @@ CreateTrigger(CreateTrigStmt *stmt)
...
@@ -255,7 +255,7 @@ CreateTrigger(CreateTrigStmt *stmt)
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
ridescs
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
ridescs
);
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
pgrel
,
tuple
);
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
pgrel
,
tuple
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
pgrel
,
RowExclusiveLock
);
heap_close
(
pgrel
,
RowExclusiveLock
);
CommandCounterIncrement
();
CommandCounterIncrement
();
...
@@ -334,7 +334,7 @@ DropTrigger(DropTrigStmt *stmt)
...
@@ -334,7 +334,7 @@ DropTrigger(DropTrigStmt *stmt)
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
ridescs
);
CatalogOpenIndices
(
Num_pg_class_indices
,
Name_pg_class_indices
,
ridescs
);
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
pgrel
,
tuple
);
CatalogIndexInsert
(
ridescs
,
Num_pg_class_indices
,
pgrel
,
tuple
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
ridescs
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
pgrel
,
RowExclusiveLock
);
heap_close
(
pgrel
,
RowExclusiveLock
);
CommandCounterIncrement
();
CommandCounterIncrement
();
...
@@ -690,7 +690,7 @@ ExecBRInsertTriggers(Relation rel, HeapTuple trigtuple)
...
@@ -690,7 +690,7 @@ ExecBRInsertTriggers(Relation rel, HeapTuple trigtuple)
if
(
newtuple
==
NULL
)
if
(
newtuple
==
NULL
)
break
;
break
;
else
if
(
oldtuple
!=
newtuple
&&
oldtuple
!=
trigtuple
)
else
if
(
oldtuple
!=
newtuple
&&
oldtuple
!=
trigtuple
)
pfre
e
(
oldtuple
);
heap_freetupl
e
(
oldtuple
);
}
}
CurrentTriggerData
=
NULL
;
CurrentTriggerData
=
NULL
;
pfree
(
SaveTriggerData
);
pfree
(
SaveTriggerData
);
...
@@ -735,11 +735,11 @@ ExecBRDeleteTriggers(EState *estate, ItemPointer tupleid)
...
@@ -735,11 +735,11 @@ ExecBRDeleteTriggers(EState *estate, ItemPointer tupleid)
if
(
newtuple
==
NULL
)
if
(
newtuple
==
NULL
)
break
;
break
;
if
(
newtuple
!=
trigtuple
)
if
(
newtuple
!=
trigtuple
)
pfre
e
(
newtuple
);
heap_freetupl
e
(
newtuple
);
}
}
CurrentTriggerData
=
NULL
;
CurrentTriggerData
=
NULL
;
pfree
(
SaveTriggerData
);
pfree
(
SaveTriggerData
);
pfre
e
(
trigtuple
);
heap_freetupl
e
(
trigtuple
);
return
(
newtuple
==
NULL
)
?
false
:
true
;
return
(
newtuple
==
NULL
)
?
false
:
true
;
}
}
...
@@ -793,11 +793,11 @@ ExecBRUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
...
@@ -793,11 +793,11 @@ ExecBRUpdateTriggers(EState *estate, ItemPointer tupleid, HeapTuple newtuple)
if
(
newtuple
==
NULL
)
if
(
newtuple
==
NULL
)
break
;
break
;
else
if
(
oldtuple
!=
newtuple
&&
oldtuple
!=
intuple
)
else
if
(
oldtuple
!=
newtuple
&&
oldtuple
!=
intuple
)
pfre
e
(
oldtuple
);
heap_freetupl
e
(
oldtuple
);
}
}
CurrentTriggerData
=
NULL
;
CurrentTriggerData
=
NULL
;
pfree
(
SaveTriggerData
);
pfree
(
SaveTriggerData
);
pfre
e
(
trigtuple
);
heap_freetupl
e
(
trigtuple
);
return
newtuple
;
return
newtuple
;
}
}
...
@@ -886,6 +886,7 @@ ltrmark:;
...
@@ -886,6 +886,7 @@ ltrmark:;
Assert
(
ItemIdIsUsed
(
lp
));
Assert
(
ItemIdIsUsed
(
lp
));
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
((
Page
)
dp
,
lp
);
tuple
.
t_len
=
ItemIdGetLength
(
lp
);
tuple
.
t_len
=
ItemIdGetLength
(
lp
);
tuple
.
t_self
=
*
tid
;
tuple
.
t_self
=
*
tid
;
...
@@ -1150,7 +1151,7 @@ deferredTriggerExecute(DeferredTriggerEvent event, int itemno)
...
@@ -1150,7 +1151,7 @@ deferredTriggerExecute(DeferredTriggerEvent event, int itemno)
rettuple
=
ExecCallTriggerFunc
(
SaveTriggerData
.
tg_trigger
);
rettuple
=
ExecCallTriggerFunc
(
SaveTriggerData
.
tg_trigger
);
CurrentTriggerData
=
NULL
;
CurrentTriggerData
=
NULL
;
if
(
rettuple
!=
NULL
&&
rettuple
!=
&
oldtuple
&&
rettuple
!=
&
newtuple
)
if
(
rettuple
!=
NULL
&&
rettuple
!=
&
oldtuple
&&
rettuple
!=
&
newtuple
)
pfre
e
(
rettuple
);
heap_freetupl
e
(
rettuple
);
/* ----------
/* ----------
* Might have been a referential integrity constraint trigger.
* Might have been a referential integrity constraint trigger.
...
...
src/backend/commands/vacuum.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.13
0 1999/12/10 03:55:49 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.13
1 1999/12/16 22:19:42 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -710,6 +710,7 @@ vc_scanheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -710,6 +710,7 @@ vc_scanheap(VRelStats *vacrelstats, Relation onerel,
continue
;
continue
;
}
}
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_len
=
ItemIdGetLength
(
itemid
);
tuple
.
t_len
=
ItemIdGetLength
(
itemid
);
ItemPointerSet
(
&
(
tuple
.
t_self
),
blkno
,
offnum
);
ItemPointerSet
(
&
(
tuple
.
t_self
),
blkno
,
offnum
);
...
@@ -1153,6 +1154,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -1153,6 +1154,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
if
(
!
ItemIdIsUsed
(
itemid
))
if
(
!
ItemIdIsUsed
(
itemid
))
continue
;
continue
;
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
itemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
itemid
);
ItemPointerSet
(
&
(
tuple
.
t_self
),
blkno
,
offnum
);
ItemPointerSet
(
&
(
tuple
.
t_self
),
blkno
,
offnum
);
...
@@ -1264,6 +1266,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -1264,6 +1266,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
elog
(
NOTICE
,
"Child itemid in update-chain marked as unused - can't continue vc_rpfheap"
);
elog
(
NOTICE
,
"Child itemid in update-chain marked as unused - can't continue vc_rpfheap"
);
break
;
break
;
}
}
tp
.
t_datamcxt
=
NULL
;
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tp
.
t_self
=
Ctid
;
tp
.
t_self
=
Ctid
;
tlen
=
tp
.
t_len
=
ItemIdGetLength
(
Citemid
);
tlen
=
tp
.
t_len
=
ItemIdGetLength
(
Citemid
);
...
@@ -1360,6 +1363,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -1360,6 +1363,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
ItemPointerGetOffsetNumber
(
&
(
tp
.
t_self
)));
ItemPointerGetOffsetNumber
(
&
(
tp
.
t_self
)));
if
(
!
ItemIdIsUsed
(
Pitemid
))
if
(
!
ItemIdIsUsed
(
Pitemid
))
elog
(
ERROR
,
"Parent itemid marked as unused"
);
elog
(
ERROR
,
"Parent itemid marked as unused"
);
Ptp
.
t_datamcxt
=
NULL
;
Ptp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Ppage
,
Pitemid
);
Ptp
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Ppage
,
Pitemid
);
Assert
(
ItemPointerEquals
(
&
(
vtld
.
new_tid
),
Assert
(
ItemPointerEquals
(
&
(
vtld
.
new_tid
),
&
(
Ptp
.
t_data
->
t_ctid
)));
&
(
Ptp
.
t_data
->
t_ctid
)));
...
@@ -1409,6 +1413,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -1409,6 +1413,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
continue
;
continue
;
}
}
#endif
#endif
tp
.
t_datamcxt
=
Ptp
.
t_datamcxt
;
tp
.
t_data
=
Ptp
.
t_data
;
tp
.
t_data
=
Ptp
.
t_data
;
tlen
=
tp
.
t_len
=
ItemIdGetLength
(
Pitemid
);
tlen
=
tp
.
t_len
=
ItemIdGetLength
(
Pitemid
);
if
(
freeCbuf
)
if
(
freeCbuf
)
...
@@ -1437,6 +1442,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
...
@@ -1437,6 +1442,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
Cpage
=
BufferGetPage
(
Cbuf
);
Cpage
=
BufferGetPage
(
Cbuf
);
Citemid
=
PageGetItemId
(
Cpage
,
Citemid
=
PageGetItemId
(
Cpage
,
ItemPointerGetOffsetNumber
(
&
(
tuple
.
t_self
)));
ItemPointerGetOffsetNumber
(
&
(
tuple
.
t_self
)));
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
Cpage
,
Citemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
Citemid
);
tuple_len
=
tuple
.
t_len
=
ItemIdGetLength
(
Citemid
);
/* Get page to move in */
/* Get page to move in */
...
@@ -1468,6 +1474,7 @@ moving chain: failed to add item with len = %u to page %u",
...
@@ -1468,6 +1474,7 @@ moving chain: failed to add item with len = %u to page %u",
}
}
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
pfree
(
newtup
.
t_data
);
pfree
(
newtup
.
t_data
);
newtup
.
t_datamcxt
=
NULL
;
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
ItemPointerSet
(
&
(
newtup
.
t_self
),
vtmove
[
ti
].
vpd
->
vpd_blkno
,
newoff
);
ItemPointerSet
(
&
(
newtup
.
t_self
),
vtmove
[
ti
].
vpd
->
vpd_blkno
,
newoff
);
...
@@ -1599,6 +1606,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
...
@@ -1599,6 +1606,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
}
}
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
newitemid
=
PageGetItemId
(
ToPage
,
newoff
);
pfree
(
newtup
.
t_data
);
pfree
(
newtup
.
t_data
);
newtup
.
t_datamcxt
=
NULL
;
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
newtup
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
ToPage
,
newitemid
);
ItemPointerSet
(
&
(
newtup
.
t_data
->
t_ctid
),
cur_page
->
vpd_blkno
,
newoff
);
ItemPointerSet
(
&
(
newtup
.
t_data
->
t_ctid
),
cur_page
->
vpd_blkno
,
newoff
);
newtup
.
t_self
=
newtup
.
t_data
->
t_ctid
;
newtup
.
t_self
=
newtup
.
t_data
->
t_ctid
;
...
@@ -1652,6 +1660,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
...
@@ -1652,6 +1660,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
itemid
=
PageGetItemId
(
page
,
off
);
itemid
=
PageGetItemId
(
page
,
off
);
if
(
!
ItemIdIsUsed
(
itemid
))
if
(
!
ItemIdIsUsed
(
itemid
))
continue
;
continue
;
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
if
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
)
if
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
)
continue
;
continue
;
...
@@ -1756,6 +1765,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
...
@@ -1756,6 +1765,7 @@ failed to add item with len = %u to page %u (free space %u, nusd %u, noff %u)",
itemid
=
PageGetItemId
(
page
,
newoff
);
itemid
=
PageGetItemId
(
page
,
newoff
);
if
(
!
ItemIdIsUsed
(
itemid
))
if
(
!
ItemIdIsUsed
(
itemid
))
continue
;
continue
;
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
if
(
!
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
))
if
(
!
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
))
{
{
...
@@ -1827,6 +1837,7 @@ Elapsed %u/%u sec.",
...
@@ -1827,6 +1837,7 @@ Elapsed %u/%u sec.",
itemid
=
PageGetItemId
(
page
,
offnum
);
itemid
=
PageGetItemId
(
page
,
offnum
);
if
(
!
ItemIdIsUsed
(
itemid
))
if
(
!
ItemIdIsUsed
(
itemid
))
continue
;
continue
;
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
tuple
.
t_data
=
(
HeapTupleHeader
)
PageGetItem
(
page
,
itemid
);
if
(
!
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
))
if
(
!
(
tuple
.
t_data
->
t_infomask
&
HEAP_XMIN_COMMITTED
))
...
@@ -2332,7 +2343,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex,
...
@@ -2332,7 +2343,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex,
/* get the buffer cache tuple */
/* get the buffer cache tuple */
rtup
.
t_self
=
ctup
->
t_self
;
rtup
.
t_self
=
ctup
->
t_self
;
heap_fetch
(
rd
,
SnapshotNow
,
&
rtup
,
&
buffer
);
heap_fetch
(
rd
,
SnapshotNow
,
&
rtup
,
&
buffer
);
pfre
e
(
ctup
);
heap_freetupl
e
(
ctup
);
/* overwrite the existing statistics in the tuple */
/* overwrite the existing statistics in the tuple */
pgcform
=
(
Form_pg_class
)
GETSTRUCT
(
&
rtup
);
pgcform
=
(
Form_pg_class
)
GETSTRUCT
(
&
rtup
);
...
@@ -2521,7 +2532,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex,
...
@@ -2521,7 +2532,7 @@ vc_updstats(Oid relid, int num_pages, int num_tuples, bool hasindex,
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_stacommonval
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_stacommonval
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_staloval
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_staloval
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_stahival
-
1
]));
pfree
(
DatumGetPointer
(
values
[
Anum_pg_statistic_stahival
-
1
]));
pfre
e
(
stup
);
heap_freetupl
e
(
stup
);
}
}
}
}
}
}
...
...
src/backend/executor/_deadcode/nodeTee.c
View file @
397e9b32
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* ExecInitTee
* ExecInitTee
* ExecEndTee
* ExecEndTee
*
*
* $Id: nodeTee.c,v 1.
6 1999/12/10 03:55:52 momjian
Exp $
* $Id: nodeTee.c,v 1.
7 1999/12/16 22:19:45 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -350,7 +350,7 @@ ExecTee(Tee * node, Plan *parent)
...
@@ -350,7 +350,7 @@ ExecTee(Tee * node, Plan *parent)
heap_insert
(
bufferRel
,
heapTuple
);
heap_insert
(
bufferRel
,
heapTuple
);
if
(
slot
->
ttc_buffer
!=
InvalidBuffer
)
if
(
slot
->
ttc_buffer
!=
InvalidBuffer
)
pfre
e
(
heapTuple
);
heap_freetupl
e
(
heapTuple
);
/*
/*
* once there is data in the temporary relation, ensure that
* once there is data in the temporary relation, ensure that
...
...
src/backend/executor/execMain.c
View file @
397e9b32
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.10
2 1999/12/10 03:55:51 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.10
3 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1147,7 +1147,7 @@ ExecAppend(TupleTableSlot *slot,
...
@@ -1147,7 +1147,7 @@ ExecAppend(TupleTableSlot *slot,
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
{
{
Assert
(
slot
->
ttc_shouldFree
);
Assert
(
slot
->
ttc_shouldFree
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
slot
->
val
=
tuple
=
newtuple
;
slot
->
val
=
tuple
=
newtuple
;
}
}
}
}
...
@@ -1334,7 +1334,7 @@ ExecReplace(TupleTableSlot *slot,
...
@@ -1334,7 +1334,7 @@ ExecReplace(TupleTableSlot *slot,
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
if
(
newtuple
!=
tuple
)
/* modified by Trigger(s) */
{
{
Assert
(
slot
->
ttc_shouldFree
);
Assert
(
slot
->
ttc_shouldFree
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
slot
->
val
=
tuple
=
newtuple
;
slot
->
val
=
tuple
=
newtuple
;
}
}
}
}
...
@@ -1472,7 +1472,7 @@ ExecAttrDefault(Relation rel, HeapTuple tuple)
...
@@ -1472,7 +1472,7 @@ ExecAttrDefault(Relation rel, HeapTuple tuple)
newtuple
=
heap_modifytuple
(
tuple
,
rel
,
replValue
,
replNull
,
repl
);
newtuple
=
heap_modifytuple
(
tuple
,
rel
,
replValue
,
replNull
,
repl
);
pfree
(
repl
);
pfree
(
repl
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
pfree
(
replNull
);
pfree
(
replNull
);
pfree
(
replValue
);
pfree
(
replValue
);
...
@@ -1614,7 +1614,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
...
@@ -1614,7 +1614,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
/* stop execution */
/* stop execution */
ExecEndNode
(
epq
->
plan
,
epq
->
plan
);
ExecEndNode
(
epq
->
plan
,
epq
->
plan
);
epqstate
->
es_tupleTable
->
next
=
0
;
epqstate
->
es_tupleTable
->
next
=
0
;
pfre
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
heap_freetupl
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
/* push current PQ to freePQ stack */
/* push current PQ to freePQ stack */
oldepq
->
free
=
epq
;
oldepq
->
free
=
epq
;
...
@@ -1689,7 +1689,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
...
@@ -1689,7 +1689,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
/* free old RTE' tuple */
/* free old RTE' tuple */
if
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
!=
NULL
)
if
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
!=
NULL
)
{
{
pfre
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
heap_freetupl
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
}
}
...
@@ -1738,7 +1738,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
...
@@ -1738,7 +1738,7 @@ EvalPlanQual(EState *estate, Index rti, ItemPointer tid)
* Nice! We got tuple - now copy it.
* Nice! We got tuple - now copy it.
*/
*/
if
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
!=
NULL
)
if
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
!=
NULL
)
pfre
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
heap_freetupl
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
heap_copytuple
(
&
tuple
);
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
heap_copytuple
(
&
tuple
);
ReleaseBuffer
(
buffer
);
ReleaseBuffer
(
buffer
);
break
;
break
;
...
@@ -1815,7 +1815,7 @@ lpqnext:;
...
@@ -1815,7 +1815,7 @@ lpqnext:;
{
{
ExecEndNode
(
epq
->
plan
,
epq
->
plan
);
ExecEndNode
(
epq
->
plan
,
epq
->
plan
);
epqstate
->
es_tupleTable
->
next
=
0
;
epqstate
->
es_tupleTable
->
next
=
0
;
pfre
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
heap_freetupl
e
(
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]);
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
epqstate
->
es_evTuple
[
epq
->
rti
-
1
]
=
NULL
;
/* pop old PQ from the stack */
/* pop old PQ from the stack */
oldepq
=
(
evalPlanQual
*
)
epqstate
->
es_evalPlanQual
;
oldepq
=
(
evalPlanQual
*
)
epqstate
->
es_evalPlanQual
;
...
...
src/backend/executor/execTuples.c
View file @
397e9b32
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.3
3 1999/12/10 03:55:51 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execTuples.c,v 1.3
4 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -120,6 +120,7 @@
...
@@ -120,6 +120,7 @@
#undef ExecStoreTuple
#undef ExecStoreTuple
#include "catalog/pg_type.h"
#include "catalog/pg_type.h"
#include "access/heapam.h"
static
TupleTableSlot
*
NodeGetResultTupleSlot
(
Plan
*
node
);
static
TupleTableSlot
*
NodeGetResultTupleSlot
(
Plan
*
node
);
...
@@ -420,7 +421,7 @@ ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
...
@@ -420,7 +421,7 @@ ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
* ----------------
* ----------------
*/
*/
if
(
slot
->
ttc_shouldFree
&&
oldtuple
!=
NULL
)
if
(
slot
->
ttc_shouldFree
&&
oldtuple
!=
NULL
)
pfre
e
(
oldtuple
);
heap_freetupl
e
(
oldtuple
);
slot
->
val
=
(
HeapTuple
)
NULL
;
slot
->
val
=
(
HeapTuple
)
NULL
;
...
...
src/backend/executor/nodeGroup.c
View file @
397e9b32
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* columns. (ie. tuples from the same group are consecutive)
* columns. (ie. tuples from the same group are consecutive)
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.3
0 1999/09/24 00:24:23 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeGroup.c,v 1.3
1 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -124,7 +124,7 @@ ExecGroupEveryTuple(Group *node)
...
@@ -124,7 +124,7 @@ ExecGroupEveryTuple(Group *node)
ExecGetScanType
(
&
grpstate
->
csstate
)))
ExecGetScanType
(
&
grpstate
->
csstate
)))
{
{
grpstate
->
grp_useFirstTuple
=
TRUE
;
grpstate
->
grp_useFirstTuple
=
TRUE
;
pfre
e
(
firsttuple
);
heap_freetupl
e
(
firsttuple
);
grpstate
->
grp_firstTuple
=
heap_copytuple
(
outerTuple
);
grpstate
->
grp_firstTuple
=
heap_copytuple
(
outerTuple
);
return
NULL
;
/* signifies the end of the group */
return
NULL
;
/* signifies the end of the group */
...
@@ -242,7 +242,7 @@ ExecGroupOneTuple(Group *node)
...
@@ -242,7 +242,7 @@ ExecGroupOneTuple(Group *node)
/* save outerTuple if we are not done yet */
/* save outerTuple if we are not done yet */
if
(
!
grpstate
->
grp_done
)
if
(
!
grpstate
->
grp_done
)
{
{
pfre
e
(
firsttuple
);
heap_freetupl
e
(
firsttuple
);
grpstate
->
grp_firstTuple
=
heap_copytuple
(
outerTuple
);
grpstate
->
grp_firstTuple
=
heap_copytuple
(
outerTuple
);
}
}
...
@@ -341,7 +341,7 @@ ExecEndGroup(Group *node)
...
@@ -341,7 +341,7 @@ ExecEndGroup(Group *node)
ExecClearTuple
(
grpstate
->
csstate
.
css_ScanTupleSlot
);
ExecClearTuple
(
grpstate
->
csstate
.
css_ScanTupleSlot
);
if
(
grpstate
->
grp_firstTuple
!=
NULL
)
if
(
grpstate
->
grp_firstTuple
!=
NULL
)
{
{
pfre
e
(
grpstate
->
grp_firstTuple
);
heap_freetupl
e
(
grpstate
->
grp_firstTuple
);
grpstate
->
grp_firstTuple
=
NULL
;
grpstate
->
grp_firstTuple
=
NULL
;
}
}
}
}
...
@@ -429,7 +429,7 @@ ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent)
...
@@ -429,7 +429,7 @@ ExecReScanGroup(Group *node, ExprContext *exprCtxt, Plan *parent)
grpstate
->
grp_done
=
FALSE
;
grpstate
->
grp_done
=
FALSE
;
if
(
grpstate
->
grp_firstTuple
!=
NULL
)
if
(
grpstate
->
grp_firstTuple
!=
NULL
)
{
{
pfre
e
(
grpstate
->
grp_firstTuple
);
heap_freetupl
e
(
grpstate
->
grp_firstTuple
);
grpstate
->
grp_firstTuple
=
NULL
;
grpstate
->
grp_firstTuple
=
NULL
;
}
}
...
...
src/backend/executor/nodeHash.c
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
*
*
* $Id: nodeHash.c,v 1.4
0 1999/12/10 03:55:51 momjian
Exp $
* $Id: nodeHash.c,v 1.4
1 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -482,6 +482,7 @@ ExecHashTableInsert(HashJoinTable hashtable,
...
@@ -482,6 +482,7 @@ ExecHashTableInsert(HashJoinTable hashtable,
memcpy
((
char
*
)
&
hashTuple
->
htup
,
memcpy
((
char
*
)
&
hashTuple
->
htup
,
(
char
*
)
heapTuple
,
(
char
*
)
heapTuple
,
sizeof
(
hashTuple
->
htup
));
sizeof
(
hashTuple
->
htup
));
hashTuple
->
htup
.
t_datamcxt
=
hashtable
->
batchCxt
;
hashTuple
->
htup
.
t_data
=
(
HeapTupleHeader
)
hashTuple
->
htup
.
t_data
=
(
HeapTupleHeader
)
(((
char
*
)
hashTuple
)
+
MAXALIGN
(
sizeof
(
*
hashTuple
)));
(((
char
*
)
hashTuple
)
+
MAXALIGN
(
sizeof
(
*
hashTuple
)));
memcpy
((
char
*
)
hashTuple
->
htup
.
t_data
,
memcpy
((
char
*
)
hashTuple
->
htup
.
t_data
,
...
...
src/backend/executor/nodeHashjoin.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.2
7 1999/10/13 15:02:25 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeHashjoin.c,v 1.2
8 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -485,6 +485,7 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
...
@@ -485,6 +485,7 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
elog
(
ERROR
,
"Read from hashjoin temp file failed"
);
elog
(
ERROR
,
"Read from hashjoin temp file failed"
);
heapTuple
=
palloc
(
HEAPTUPLESIZE
+
htup
.
t_len
);
heapTuple
=
palloc
(
HEAPTUPLESIZE
+
htup
.
t_len
);
memcpy
((
char
*
)
heapTuple
,
(
char
*
)
&
htup
,
sizeof
(
HeapTupleData
));
memcpy
((
char
*
)
heapTuple
,
(
char
*
)
&
htup
,
sizeof
(
HeapTupleData
));
heapTuple
->
t_datamcxt
=
CurrentMemoryContext
;
heapTuple
->
t_data
=
(
HeapTupleHeader
)
heapTuple
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
heapTuple
+
HEAPTUPLESIZE
);
((
char
*
)
heapTuple
+
HEAPTUPLESIZE
);
nread
=
BufFileRead
(
file
,
(
void
*
)
heapTuple
->
t_data
,
htup
.
t_len
);
nread
=
BufFileRead
(
file
,
(
void
*
)
heapTuple
->
t_data
,
htup
.
t_len
);
...
...
src/backend/executor/nodeSubplan.c
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.1
7 1999/11/15 03:28:05 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeSubplan.c,v 1.1
8 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -117,7 +117,7 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext, bool *isNull)
...
@@ -117,7 +117,7 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext, bool *isNull)
*/
*/
tup
=
heap_copytuple
(
tup
);
tup
=
heap_copytuple
(
tup
);
if
(
node
->
curTuple
)
if
(
node
->
curTuple
)
pfre
e
(
node
->
curTuple
);
heap_freetupl
e
(
node
->
curTuple
);
node
->
curTuple
=
tup
;
node
->
curTuple
=
tup
;
result
=
heap_getattr
(
tup
,
col
,
tdesc
,
isNull
);
result
=
heap_getattr
(
tup
,
col
,
tdesc
,
isNull
);
/* keep scanning subplan to make sure there's only one tuple */
/* keep scanning subplan to make sure there's only one tuple */
...
@@ -351,7 +351,7 @@ ExecSetParamPlan(SubPlan *node)
...
@@ -351,7 +351,7 @@ ExecSetParamPlan(SubPlan *node)
*/
*/
tup
=
heap_copytuple
(
tup
);
tup
=
heap_copytuple
(
tup
);
if
(
node
->
curTuple
)
if
(
node
->
curTuple
)
pfre
e
(
node
->
curTuple
);
heap_freetupl
e
(
node
->
curTuple
);
node
->
curTuple
=
tup
;
node
->
curTuple
=
tup
;
foreach
(
lst
,
node
->
setParam
)
foreach
(
lst
,
node
->
setParam
)
...
@@ -408,7 +408,7 @@ ExecEndSubPlan(SubPlan *node)
...
@@ -408,7 +408,7 @@ ExecEndSubPlan(SubPlan *node)
}
}
if
(
node
->
curTuple
)
if
(
node
->
curTuple
)
{
{
pfre
e
(
node
->
curTuple
);
heap_freetupl
e
(
node
->
curTuple
);
node
->
curTuple
=
NULL
;
node
->
curTuple
=
NULL
;
}
}
}
}
...
...
src/backend/executor/nodeTidscan.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.
1 1999/11/23 20:06:51 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeTidscan.c,v 1.
2 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -148,6 +148,7 @@ TidNext(TidScan *node)
...
@@ -148,6 +148,7 @@ TidNext(TidScan *node)
bool
slot_is_valid
=
false
;
bool
slot_is_valid
=
false
;
itemptr
=
tidList
[
tidstate
->
tss_TidPtr
];
itemptr
=
tidList
[
tidstate
->
tss_TidPtr
];
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
if
(
itemptr
)
if
(
itemptr
)
{
{
...
...
src/backend/executor/spi.c
View file @
397e9b32
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* spi.c
* spi.c
* Server Programming Interface
* Server Programming Interface
*
*
* $Id: spi.c,v 1.4
3 1999/12/10 03:55:51 momjian
Exp $
* $Id: spi.c,v 1.4
4 1999/12/16 22:19:44 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -543,6 +543,26 @@ SPI_pfree(void *pointer)
...
@@ -543,6 +543,26 @@ SPI_pfree(void *pointer)
return
;
return
;
}
}
void
SPI_freetuple
(
HeapTuple
tuple
)
{
MemoryContext
oldcxt
=
NULL
;
if
(
_SPI_curid
+
1
==
_SPI_connected
)
/* connected */
{
if
(
_SPI_current
!=
&
(
_SPI_stack
[
_SPI_curid
+
1
]))
elog
(
FATAL
,
"SPI: stack corrupted"
);
oldcxt
=
MemoryContextSwitchTo
(
_SPI_current
->
savedcxt
);
}
heap_freetuple
(
tuple
);
if
(
oldcxt
)
MemoryContextSwitchTo
(
oldcxt
);
return
;
}
/* =================== private functions =================== */
/* =================== private functions =================== */
/*
/*
...
...
src/backend/nodes/freefuncs.c
View file @
397e9b32
...
@@ -7,15 +7,15 @@
...
@@ -7,15 +7,15 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.2
8 1999/11/23 20:06:53 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/nodes/Attic/freefuncs.c,v 1.2
9 1999/12/16 22:19:47 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
#include "postgres.h"
#include "postgres.h"
#include "optimizer/planmain.h"
#include "optimizer/planmain.h"
#include "access/heapam.h"
/* ****************************************************************
/* ****************************************************************
* plannodes.h free functions
* plannodes.h free functions
...
@@ -465,7 +465,7 @@ _freeSubPlan(SubPlan *node)
...
@@ -465,7 +465,7 @@ _freeSubPlan(SubPlan *node)
freeObject
(
node
->
sublink
);
freeObject
(
node
->
sublink
);
if
(
node
->
curTuple
)
if
(
node
->
curTuple
)
pfre
e
(
node
->
curTuple
);
heap_freetupl
e
(
node
->
curTuple
);
pfree
(
node
);
pfree
(
node
);
}
}
...
...
src/backend/parser/parse_func.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.6
4 1999/12/10 07:37:35 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.6
5 1999/12/16 22:19:48 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -697,6 +697,8 @@ func_get_candidates(char *funcname, int nargs)
...
@@ -697,6 +697,8 @@ func_get_candidates(char *funcname, int nargs)
{
{
Buffer
buffer
;
Buffer
buffer
;
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
NULL
;
tuple
.
t_self
=
indexRes
->
heap_iptr
;
tuple
.
t_self
=
indexRes
->
heap_iptr
;
heap_fetch
(
heapRelation
,
SnapshotNow
,
&
tuple
,
&
buffer
);
heap_fetch
(
heapRelation
,
SnapshotNow
,
&
tuple
,
&
buffer
);
pfree
(
indexRes
);
pfree
(
indexRes
);
...
...
src/backend/rewrite/rewriteRemove.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.3
3 1999/11/22 17:56:23 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteRemove.c,v 1.3
4 1999/12/16 22:19:49 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -108,7 +108,7 @@ RemoveRewriteRule(char *ruleName)
...
@@ -108,7 +108,7 @@ RemoveRewriteRule(char *ruleName)
if
(
isNull
)
if
(
isNull
)
{
{
/* XXX strange!!! */
/* XXX strange!!! */
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
elog
(
ERROR
,
"RemoveRewriteRule: internal error; null event target relation!"
);
elog
(
ERROR
,
"RemoveRewriteRule: internal error; null event target relation!"
);
}
}
eventRelationOid
=
DatumGetObjectId
(
eventRelationOidDatum
);
eventRelationOid
=
DatumGetObjectId
(
eventRelationOidDatum
);
...
@@ -133,7 +133,7 @@ RemoveRewriteRule(char *ruleName)
...
@@ -133,7 +133,7 @@ RemoveRewriteRule(char *ruleName)
*/
*/
heap_delete
(
RewriteRelation
,
&
tuple
->
t_self
,
NULL
);
heap_delete
(
RewriteRelation
,
&
tuple
->
t_self
,
NULL
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
RewriteRelation
,
RowExclusiveLock
);
heap_close
(
RewriteRelation
,
RowExclusiveLock
);
}
}
...
...
src/backend/rewrite/rewriteSupport.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.
39 1999/11/24 00:44:34 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.
40 1999/12/16 22:19:50 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -113,7 +113,7 @@ setRelhasrulesInRelation(Oid relationId, bool relhasrules)
...
@@ -113,7 +113,7 @@ setRelhasrulesInRelation(Oid relationId, bool relhasrules)
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
relationRelation
,
tuple
);
CatalogIndexInsert
(
idescs
,
Num_pg_class_indices
,
relationRelation
,
tuple
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
CatalogCloseIndices
(
Num_pg_class_indices
,
idescs
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
heap_close
(
relationRelation
,
RowExclusiveLock
);
heap_close
(
relationRelation
,
RowExclusiveLock
);
}
}
...
...
src/backend/storage/large_object/inv_api.c
View file @
397e9b32
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.6
2 1999/12/10 03:55:57 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.6
3 1999/12/16 22:19:51 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -654,6 +654,7 @@ inv_fetchtup(LargeObjectDesc *obj_desc, HeapTuple tuple, Buffer *buffer)
...
@@ -654,6 +654,7 @@ inv_fetchtup(LargeObjectDesc *obj_desc, HeapTuple tuple, Buffer *buffer)
if
(
res
==
(
RetrieveIndexResult
)
NULL
)
if
(
res
==
(
RetrieveIndexResult
)
NULL
)
{
{
ItemPointerSetInvalid
(
&
(
obj_desc
->
htid
));
ItemPointerSetInvalid
(
&
(
obj_desc
->
htid
));
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_data
=
NULL
;
tuple
->
t_data
=
NULL
;
return
;
return
;
}
}
...
@@ -797,7 +798,7 @@ inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes)
...
@@ -797,7 +798,7 @@ inv_wrnew(LargeObjectDesc *obj_desc, char *buf, int nbytes)
ntup
=
inv_newtuple
(
obj_desc
,
buffer
,
page
,
buf
,
nwritten
);
ntup
=
inv_newtuple
(
obj_desc
,
buffer
,
page
,
buf
,
nwritten
);
inv_indextup
(
obj_desc
,
ntup
);
inv_indextup
(
obj_desc
,
ntup
);
pfre
e
(
ntup
);
heap_freetupl
e
(
ntup
);
/* new tuple is inserted */
/* new tuple is inserted */
WriteBuffer
(
buffer
);
WriteBuffer
(
buffer
);
...
@@ -971,7 +972,7 @@ inv_wrold(LargeObjectDesc *obj_desc,
...
@@ -971,7 +972,7 @@ inv_wrold(LargeObjectDesc *obj_desc,
/* index the new tuple */
/* index the new tuple */
inv_indextup
(
obj_desc
,
ntup
);
inv_indextup
(
obj_desc
,
ntup
);
pfre
e
(
ntup
);
heap_freetupl
e
(
ntup
);
/*
/*
* move the scandesc forward so we don't reread the newly inserted
* move the scandesc forward so we don't reread the newly inserted
...
@@ -1059,6 +1060,7 @@ inv_newtuple(LargeObjectDesc *obj_desc,
...
@@ -1059,6 +1060,7 @@ inv_newtuple(LargeObjectDesc *obj_desc,
ph
->
pd_lower
=
lower
;
ph
->
pd_lower
=
lower
;
ph
->
pd_upper
=
upper
;
ph
->
pd_upper
=
upper
;
ntup
->
t_datamcxt
=
NULL
;
ntup
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
page
+
upper
);
ntup
->
t_data
=
(
HeapTupleHeader
)
((
char
*
)
page
+
upper
);
/*
/*
...
...
src/backend/utils/adt/regproc.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.4
5 1999/11/22 17:56:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.4
6 1999/12/16 22:19:52 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -84,6 +84,8 @@ regprocin(char *pro_name_or_oid)
...
@@ -84,6 +84,8 @@ regprocin(char *pro_name_or_oid)
sd
=
index_beginscan
(
idesc
,
false
,
1
,
skey
);
sd
=
index_beginscan
(
idesc
,
false
,
1
,
skey
);
while
((
indexRes
=
index_getnext
(
sd
,
ForwardScanDirection
)))
while
((
indexRes
=
index_getnext
(
sd
,
ForwardScanDirection
)))
{
{
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
NULL
;
tuple
.
t_self
=
indexRes
->
heap_iptr
;
tuple
.
t_self
=
indexRes
->
heap_iptr
;
heap_fetch
(
hdesc
,
SnapshotNow
,
heap_fetch
(
hdesc
,
SnapshotNow
,
&
tuple
,
&
tuple
,
...
...
src/backend/utils/cache/catcache.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.5
4 1999/11/22 17:56:31 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.5
5 1999/12/16 22:19:54 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -839,7 +839,7 @@ SearchSelfReferences(struct catcache * cache)
...
@@ -839,7 +839,7 @@ SearchSelfReferences(struct catcache * cache)
elog
(
ERROR
,
"SearchSelfReferences: %s not found in %s"
,
elog
(
ERROR
,
"SearchSelfReferences: %s not found in %s"
,
IndexRelidIndex
,
RelationRelationName
);
IndexRelidIndex
,
RelationRelationName
);
indexSelfOid
=
ntp
->
t_data
->
t_oid
;
indexSelfOid
=
ntp
->
t_data
->
t_oid
;
pfre
e
(
ntp
);
heap_freetupl
e
(
ntp
);
heap_close
(
rel
,
AccessShareLock
);
heap_close
(
rel
,
AccessShareLock
);
}
}
/* Looking for something other than pg_index_indexrelid_index? */
/* Looking for something other than pg_index_indexrelid_index? */
...
...
src/backend/utils/cache/relcache.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.8
1 1999/11/22 17:56:32 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.8
2 1999/12/16 22:19:54 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -871,7 +871,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo,
...
@@ -871,7 +871,7 @@ RelationBuildDesc(RelationBuildDescInfo buildinfo,
* and for lock data pointed to by pg_class_tuple
* and for lock data pointed to by pg_class_tuple
* -------------------
* -------------------
*/
*/
pfre
e
(
pg_class_tuple
);
heap_freetupl
e
(
pg_class_tuple
);
MemoryContextSwitchTo
(
oldcxt
);
MemoryContextSwitchTo
(
oldcxt
);
...
@@ -1714,6 +1714,7 @@ AttrDefaultFetch(Relation relation)
...
@@ -1714,6 +1714,7 @@ AttrDefaultFetch(Relation relation)
adrel
=
heap_openr
(
AttrDefaultRelationName
,
AccessShareLock
);
adrel
=
heap_openr
(
AttrDefaultRelationName
,
AccessShareLock
);
irel
=
index_openr
(
AttrDefaultIndex
);
irel
=
index_openr
(
AttrDefaultIndex
);
sd
=
index_beginscan
(
irel
,
false
,
1
,
&
skey
);
sd
=
index_beginscan
(
irel
,
false
,
1
,
&
skey
);
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
NULL
;
tuple
.
t_data
=
NULL
;
for
(
found
=
0
;;)
for
(
found
=
0
;;)
...
@@ -1793,6 +1794,7 @@ RelCheckFetch(Relation relation)
...
@@ -1793,6 +1794,7 @@ RelCheckFetch(Relation relation)
rcrel
=
heap_openr
(
RelCheckRelationName
,
AccessShareLock
);
rcrel
=
heap_openr
(
RelCheckRelationName
,
AccessShareLock
);
irel
=
index_openr
(
RelCheckIndex
);
irel
=
index_openr
(
RelCheckIndex
);
sd
=
index_beginscan
(
irel
,
false
,
1
,
&
skey
);
sd
=
index_beginscan
(
irel
,
false
,
1
,
&
skey
);
tuple
.
t_datamcxt
=
NULL
;
tuple
.
t_data
=
NULL
;
tuple
.
t_data
=
NULL
;
for
(
found
=
0
;;)
for
(
found
=
0
;;)
...
...
src/backend/utils/misc/database.c
View file @
397e9b32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.3
2 1999/11/07 23:08:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.3
3 1999/12/16 22:19:55 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -222,6 +222,7 @@ GetRawDatabaseInfo(char *name, Oid *db_id, char *path)
...
@@ -222,6 +222,7 @@ GetRawDatabaseInfo(char *name, Oid *db_id, char *path)
/* get a pointer to the tuple itself */
/* get a pointer to the tuple itself */
offset
=
(
int
)
ph
->
pd_linp
[
i
].
lp_off
;
offset
=
(
int
)
ph
->
pd_linp
[
i
].
lp_off
;
tup
.
t_datamcxt
=
NULL
;
tup
.
t_data
=
(
HeapTupleHeader
)
(((
char
*
)
pg
)
+
offset
);
tup
.
t_data
=
(
HeapTupleHeader
)
(((
char
*
)
pg
)
+
offset
);
/*
/*
...
...
src/backend/utils/sort/tuplesort.c
View file @
397e9b32
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.
3 1999/12/13 01:27:04 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/sort/tuplesort.c,v 1.
4 1999/12/16 22:19:56 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1697,7 +1697,7 @@ writetup_heap(Tuplesortstate *state, int tapenum, void *tup)
...
@@ -1697,7 +1697,7 @@ writetup_heap(Tuplesortstate *state, int tapenum, void *tup)
(
void
*
)
&
tuplen
,
sizeof
(
tuplen
));
(
void
*
)
&
tuplen
,
sizeof
(
tuplen
));
FREEMEM
(
state
,
HEAPTUPLESIZE
+
tuple
->
t_len
);
FREEMEM
(
state
,
HEAPTUPLESIZE
+
tuple
->
t_len
);
pfre
e
(
tuple
);
heap_freetupl
e
(
tuple
);
}
}
static
void
*
static
void
*
...
@@ -1710,6 +1710,7 @@ readtup_heap(Tuplesortstate *state, int tapenum, unsigned int len)
...
@@ -1710,6 +1710,7 @@ readtup_heap(Tuplesortstate *state, int tapenum, unsigned int len)
/* reconstruct the HeapTupleData portion */
/* reconstruct the HeapTupleData portion */
tuple
->
t_len
=
len
-
sizeof
(
unsigned
int
);
tuple
->
t_len
=
len
-
sizeof
(
unsigned
int
);
ItemPointerSetInvalid
(
&
(
tuple
->
t_self
));
ItemPointerSetInvalid
(
&
(
tuple
->
t_self
));
tuple
->
t_datamcxt
=
CurrentMemoryContext
;
tuple
->
t_data
=
(
HeapTupleHeader
)
(((
char
*
)
tuple
)
+
HEAPTUPLESIZE
);
tuple
->
t_data
=
(
HeapTupleHeader
)
(((
char
*
)
tuple
)
+
HEAPTUPLESIZE
);
/* read in the tuple proper */
/* read in the tuple proper */
if
(
LogicalTapeRead
(
state
->
tapeset
,
tapenum
,
(
void
*
)
tuple
->
t_data
,
if
(
LogicalTapeRead
(
state
->
tapeset
,
tapenum
,
(
void
*
)
tuple
->
t_data
,
...
...
src/include/access/heapam.h
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: heapam.h,v 1.4
8 1999/11/24 00:44:37 momjian
Exp $
* $Id: heapam.h,v 1.4
9 1999/12/16 22:19:58 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -281,6 +281,7 @@ extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
...
@@ -281,6 +281,7 @@ extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
Datum
*
value
,
char
*
nulls
);
Datum
*
value
,
char
*
nulls
);
extern
HeapTuple
heap_modifytuple
(
HeapTuple
tuple
,
extern
HeapTuple
heap_modifytuple
(
HeapTuple
tuple
,
Relation
relation
,
Datum
*
replValue
,
char
*
replNull
,
char
*
repl
);
Relation
relation
,
Datum
*
replValue
,
char
*
replNull
,
char
*
repl
);
extern
void
heap_freetuple
(
HeapTuple
tuple
);
HeapTuple
heap_addheader
(
uint32
natts
,
int
structlen
,
char
*
structure
);
HeapTuple
heap_addheader
(
uint32
natts
,
int
structlen
,
char
*
structure
);
/* in common/heap/stats.c */
/* in common/heap/stats.c */
...
...
src/include/access/htup.h
View file @
397e9b32
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* Copyright (c) 1994, Regents of the University of California
*
*
* $Id: htup.h,v 1.2
5 1999/07/19 07:07:28 momjian
Exp $
* $Id: htup.h,v 1.2
6 1999/12/16 22:19:58 wieck
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -78,11 +78,17 @@ extern long heap_sysoffset[];
...
@@ -78,11 +78,17 @@ extern long heap_sysoffset[];
* updated version of tuple (required by MVCC);
* updated version of tuple (required by MVCC);
* 3. someday someone let tuple to cross block boundaries -
* 3. someday someone let tuple to cross block boundaries -
* he have to add something below...
* he have to add something below...
*
* Change for 7.0:
* Up to now t_data could be NULL, the memory location directly following
* HeapTupleData or pointing into a buffer. Now, it could also point to
* a separate allocation that was done in the t_datamcxt memory context.
*/
*/
typedef
struct
HeapTupleData
typedef
struct
HeapTupleData
{
{
uint32
t_len
;
/* length of *t_data */
uint32
t_len
;
/* length of *t_data */
ItemPointerData
t_self
;
/* SelfItemPointer */
ItemPointerData
t_self
;
/* SelfItemPointer */
MemoryContext
t_datamcxt
;
/* */
HeapTupleHeader
t_data
;
/* */
HeapTupleHeader
t_data
;
/* */
}
HeapTupleData
;
}
HeapTupleData
;
...
...
src/include/executor/spi.h
View file @
397e9b32
...
@@ -93,5 +93,6 @@ extern char *SPI_getrelname(Relation rel);
...
@@ -93,5 +93,6 @@ extern char *SPI_getrelname(Relation rel);
extern
void
*
SPI_palloc
(
Size
size
);
extern
void
*
SPI_palloc
(
Size
size
);
extern
void
*
SPI_repalloc
(
void
*
pointer
,
Size
size
);
extern
void
*
SPI_repalloc
(
void
*
pointer
,
Size
size
);
extern
void
SPI_pfree
(
void
*
pointer
);
extern
void
SPI_pfree
(
void
*
pointer
);
extern
void
SPI_freetuple
(
HeapTuple
pointer
);
#endif
/* SPI_H */
#endif
/* SPI_H */
src/test/regress/regress.c
View file @
397e9b32
/*
/*
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.3
4 1999/10/22 02:08:37 tgl
Exp $
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.3
5 1999/12/16 22:20:03 wieck
Exp $
*/
*/
#include <float.h>
/* faked on sunos */
#include <float.h>
/* faked on sunos */
...
@@ -608,7 +608,7 @@ ttdummy()
...
@@ -608,7 +608,7 @@ ttdummy()
tmptuple
=
SPI_copytuple
(
trigtuple
);
tmptuple
=
SPI_copytuple
(
trigtuple
);
rettuple
=
SPI_modifytuple
(
rel
,
tmptuple
,
1
,
&
(
attnum
[
1
]),
&
newoff
,
NULL
);
rettuple
=
SPI_modifytuple
(
rel
,
tmptuple
,
1
,
&
(
attnum
[
1
]),
&
newoff
,
NULL
);
SPI_
pfre
e
(
tmptuple
);
SPI_
freetupl
e
(
tmptuple
);
}
}
else
else
/* DELETE */
/* DELETE */
...
...
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