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
e1a118e5
Commit
e1a118e5
authored
Jul 04, 2000
by
Vadim B. Mikheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unlock buffer before releasing in heap_insert
+unlock buffer in heap_fetch under !ItemIdIsUsed().
parent
13647ad6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
9 deletions
+50
-9
src/backend/access/heap/heapam.c
src/backend/access/heap/heapam.c
+50
-9
No files found.
src/backend/access/heap/heapam.c
View file @
e1a118e5
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.7
7 2000/07/03 23:58:32 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.7
8 2000/07/04 01:39:24 vadim
Exp $
*
*
*
*
* INTERFACE ROUTINES
* INTERFACE ROUTINES
...
@@ -1125,6 +1125,7 @@ heap_fetch(Relation relation,
...
@@ -1125,6 +1125,7 @@ heap_fetch(Relation relation,
if
(
!
ItemIdIsUsed
(
lp
))
if
(
!
ItemIdIsUsed
(
lp
))
{
{
LockBuffer
(
buffer
,
BUFFER_LOCK_UNLOCK
);
ReleaseBuffer
(
buffer
);
ReleaseBuffer
(
buffer
);
*
userbuf
=
InvalidBuffer
;
*
userbuf
=
InvalidBuffer
;
tuple
->
t_datamcxt
=
NULL
;
tuple
->
t_datamcxt
=
NULL
;
...
@@ -1331,17 +1332,17 @@ heap_insert(Relation relation, HeapTuple tup)
...
@@ -1331,17 +1332,17 @@ heap_insert(Relation relation, HeapTuple tup)
xlrec
.
mask
=
tup
->
t_data
->
t_infomask
;
xlrec
.
mask
=
tup
->
t_data
->
t_infomask
;
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_INSERT
,
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_INSERT
,
(
char
*
)
xlrec
,
sizeof
(
xlrec
)
,
(
char
*
)
xlrec
,
SizeOfHeapInsert
,
(
char
*
)
tup
->
t_data
+
offsetof
(
HeapTupleHeaderData
,
tbits
),
(
char
*
)
tup
->
t_data
+
offsetof
(
HeapTupleHeaderData
,
t
_
bits
),
tup
->
t_len
-
offsetof
(
HeapTupleHeaderData
,
tbits
));
tup
->
t_len
-
offsetof
(
HeapTupleHeaderData
,
t
_
bits
));
((
PageHeader
)
BufferGetPage
(
buffer
))
->
pd_lsn
=
recptr
;
((
PageHeader
)
BufferGetPage
(
buffer
))
->
pd_lsn
=
recptr
;
((
PageHeader
)
BufferGetPage
(
buffer
))
->
pd_sui
=
ThisStartUpID
;
((
PageHeader
)
BufferGetPage
(
buffer
))
->
pd_sui
=
ThisStartUpID
;
}
}
#endif
#endif
WriteBuffer
(
buffer
);
LockBuffer
(
buffer
,
BUFFER_LOCK_UNLOCK
);
LockBuffer
(
buffer
,
BUFFER_LOCK_UNLOCK
);
WriteBuffer
(
buffer
);
if
(
IsSystemRelationName
(
RelationGetRelationName
(
relation
)))
if
(
IsSystemRelationName
(
RelationGetRelationName
(
relation
)))
RelationMark4RollbackHeapTuple
(
relation
,
tup
);
RelationMark4RollbackHeapTuple
(
relation
,
tup
);
...
@@ -1440,7 +1441,7 @@ l1:
...
@@ -1440,7 +1441,7 @@ l1:
xlrec
.
dtid
.
cid
=
GetCurrentCommandId
();
xlrec
.
dtid
.
cid
=
GetCurrentCommandId
();
xlrec
.
dtid
.
tid
=
tp
.
t_self
;
xlrec
.
dtid
.
tid
=
tp
.
t_self
;
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_DELETE
,
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_DELETE
,
(
char
*
)
xlrec
,
sizeof
(
xlrec
)
,
NULL
,
0
);
(
char
*
)
xlrec
,
SizeOfHeapDelete
,
NULL
,
0
);
dp
->
pd_lsn
=
recptr
;
dp
->
pd_lsn
=
recptr
;
dp
->
pd_sui
=
ThisStartUpID
;
dp
->
pd_sui
=
ThisStartUpID
;
...
@@ -1610,9 +1611,9 @@ l2:
...
@@ -1610,9 +1611,9 @@ l2:
xlrec
.
mask
=
newtup
->
t_data
->
t_infomask
;
xlrec
.
mask
=
newtup
->
t_data
->
t_infomask
;
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_UPDATE
,
XLogRecPtr
recptr
=
XLogInsert
(
RM_HEAP_ID
,
XLOG_HEAP_UPDATE
,
(
char
*
)
xlrec
,
sizeof
(
xlrec
)
,
(
char
*
)
xlrec
,
SizeOfHeapUpdate
,
(
char
*
)
newtup
->
t_data
+
offsetof
(
HeapTupleHeaderData
,
tbits
),
(
char
*
)
newtup
->
t_data
+
offsetof
(
HeapTupleHeaderData
,
t
_
bits
),
newtup
->
t_len
-
offsetof
(
HeapTupleHeaderData
,
tbits
));
newtup
->
t_len
-
offsetof
(
HeapTupleHeaderData
,
t
_
bits
));
if
(
newbuf
!=
buffer
)
if
(
newbuf
!=
buffer
)
{
{
...
@@ -1907,3 +1908,43 @@ heap_restrpos(HeapScanDesc scan)
...
@@ -1907,3 +1908,43 @@ heap_restrpos(HeapScanDesc scan)
(
ScanKey
)
NULL
);
(
ScanKey
)
NULL
);
}
}
}
}
#ifdef XLOG
void
heap_redo
(
XLogRecPtr
lsn
,
XLogRecord
*
record
)
{
uint8
info
=
record
->
xl_info
&
~
XLR_INFO_MASK
;
if
(
info
==
XLOG_HEAP_INSERT
)
heap_xlog_insert
(
true
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_DELETE
)
heap_xlog_delete
(
true
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_UPDATE
)
heap_xlog_update
(
true
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_MOVE
)
heap_xlog_move
(
true
,
lsn
,
record
);
else
elog
(
STOP
,
"heap_redo: unknown op code %u"
,
info
);
}
void
heap_undo
(
XLogRecPtr
lsn
,
XLogRecord
*
record
)
{
uint8
info
=
record
->
xl_info
&
~
XLR_INFO_MASK
;
if
(
info
==
XLOG_HEAP_INSERT
)
heap_xlog_insert
(
false
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_DELETE
)
heap_xlog_delete
(
false
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_UPDATE
)
heap_xlog_update
(
false
,
lsn
,
record
);
else
if
(
info
==
XLOG_HEAP_MOVE
)
heap_xlog_move
(
false
,
lsn
,
record
);
else
elog
(
STOP
,
"heap_undo: unknown op code %u"
,
info
);
}
void
heap_xlog_insert
(
bool
redo
,
XLogRecPtr
lsn
,
XLogRecord
*
record
)
{
xl_heap_insert
xlrec
=
XLogRecGetData
(
record
);
}
#endif
/* XLOG */
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