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
20ca834c
Commit
20ca834c
authored
Jul 13, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor code cleanup/beautification in RelationPutHeapTuple.
parent
379ac0d0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
src/backend/access/heap/hio.c
src/backend/access/heap/hio.c
+11
-15
No files found.
src/backend/access/heap/hio.c
View file @
20ca834c
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Id: hio.c,v 1.4
1 2001/06/29 21:08:23
tgl Exp $
* $Id: hio.c,v 1.4
2 2001/07/13 22:52:58
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -25,8 +25,7 @@
...
@@ -25,8 +25,7 @@
*
*
* !!! ELOG(ERROR) IS DISALLOWED HERE !!!
* !!! ELOG(ERROR) IS DISALLOWED HERE !!!
*
*
* Note - we assume that caller hold BUFFER_LOCK_EXCLUSIVE on the buffer.
* Note - caller must hold BUFFER_LOCK_EXCLUSIVE on the buffer.
*
*/
*/
void
void
RelationPutHeapTuple
(
Relation
relation
,
RelationPutHeapTuple
(
Relation
relation
,
...
@@ -35,7 +34,6 @@ RelationPutHeapTuple(Relation relation,
...
@@ -35,7 +34,6 @@ RelationPutHeapTuple(Relation relation,
{
{
Page
pageHeader
;
Page
pageHeader
;
OffsetNumber
offnum
;
OffsetNumber
offnum
;
Size
len
;
ItemId
itemId
;
ItemId
itemId
;
Item
item
;
Item
item
;
...
@@ -45,24 +43,22 @@ RelationPutHeapTuple(Relation relation,
...
@@ -45,24 +43,22 @@ RelationPutHeapTuple(Relation relation,
IncrHeapAccessStat
(
local_RelationPutHeapTuple
);
IncrHeapAccessStat
(
local_RelationPutHeapTuple
);
IncrHeapAccessStat
(
global_RelationPutHeapTuple
);
IncrHeapAccessStat
(
global_RelationPutHeapTuple
);
pageHeader
=
(
Page
)
BufferGetPage
(
buffer
);
/* Add the tuple to the page */
len
=
MAXALIGN
(
tuple
->
t_len
);
/* be conservative */
pageHeader
=
BufferGetPage
(
buffer
);
Assert
(
len
<=
PageGetFreeSpace
(
pageHeader
));
offnum
=
PageAddItem
(
(
Page
)
pageHeader
,
(
Item
)
tuple
->
t_data
,
offnum
=
PageAddItem
(
pageHeader
,
(
Item
)
tuple
->
t_data
,
tuple
->
t_len
,
InvalidOffsetNumber
,
LP_USED
);
tuple
->
t_len
,
InvalidOffsetNumber
,
LP_USED
);
if
(
offnum
==
InvalidOffsetNumber
)
if
(
offnum
==
InvalidOffsetNumber
)
elog
(
STOP
,
"RelationPutHeapTuple: failed to add tuple"
);
elog
(
STOP
,
"RelationPutHeapTuple: failed to add tuple"
);
itemId
=
PageGetItemId
((
Page
)
pageHeader
,
offnum
);
/* Update tuple->t_self to the actual position where it was stored */
item
=
PageGetItem
((
Page
)
pageHeader
,
itemId
);
ItemPointerSet
(
&
(
tuple
->
t_self
),
BufferGetBlockNumber
(
buffer
),
offnum
);
ItemPointerSet
(
&
((
HeapTupleHeader
)
item
)
->
t_ctid
,
BufferGetBlockNumber
(
buffer
),
offnum
);
/* return an accurate tuple */
/* Insert the correct position into CTID of the stored tuple, too */
ItemPointerSet
(
&
tuple
->
t_self
,
BufferGetBlockNumber
(
buffer
),
offnum
);
itemId
=
PageGetItemId
(
pageHeader
,
offnum
);
item
=
PageGetItem
(
pageHeader
,
itemId
);
((
HeapTupleHeader
)
item
)
->
t_ctid
=
tuple
->
t_self
;
}
}
/*
/*
...
...
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