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
40055db1
Commit
40055db1
authored
Feb 03, 2000
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Repair relation refcount leakage caused by SELECT FOR UPDATE.
parent
31a8996b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
15 deletions
+26
-15
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+26
-15
No files found.
src/backend/executor/execMain.c
View file @
40055db1
...
...
@@ -27,7 +27,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.10
7 2000/01/26 05:56:21 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.10
8 2000/02/03 00:02:58 tgl
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -596,19 +596,19 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
estate
->
es_rowMark
=
NULL
;
if
(
parseTree
->
rowMark
!=
NULL
)
{
Relation
relation
;
Oid
relid
;
RowMark
*
rm
;
List
*
l
;
execRowMark
*
erm
;
foreach
(
l
,
parseTree
->
rowMark
)
{
rm
=
lfirst
(
l
);
relid
=
rt_fetch
(
rm
->
rti
,
rangeTable
)
->
relid
;
relation
=
heap_open
(
relid
,
RowShareLock
);
RowMark
*
rm
=
lfirst
(
l
);
Oid
relid
;
Relation
relation
;
execRowMark
*
erm
;
if
(
!
(
rm
->
info
&
ROW_MARK_FOR_UPDATE
))
continue
;
relid
=
rt_fetch
(
rm
->
rti
,
rangeTable
)
->
relid
;
relation
=
heap_open
(
relid
,
RowShareLock
);
erm
=
(
execRowMark
*
)
palloc
(
sizeof
(
execRowMark
));
erm
->
relation
=
relation
;
erm
->
rti
=
rm
->
rti
;
...
...
@@ -756,6 +756,7 @@ EndPlan(Plan *plan, EState *estate)
{
RelationInfo
*
resultRelationInfo
;
Relation
intoRelationDesc
;
List
*
l
;
/*
* get information from state
...
...
@@ -796,10 +797,20 @@ EndPlan(Plan *plan, EState *estate)
}
/*
* close the "into" relation if necessary
* close the "into" relation if necessary
, again keeping lock
*/
if
(
intoRelationDesc
!=
NULL
)
heap_close
(
intoRelationDesc
,
NoLock
);
/*
* close any relations selected FOR UPDATE, again keeping locks
*/
foreach
(
l
,
estate
->
es_rowMark
)
{
execRowMark
*
erm
=
lfirst
(
l
);
heap_close
(
erm
->
relation
,
NoLock
);
}
}
/* ----------------------------------------------------------------
...
...
@@ -926,16 +937,16 @@ lnext: ;
else
if
(
estate
->
es_rowMark
!=
NULL
)
{
List
*
l
;
execRowMark
*
erm
;
lmark:
;
foreach
(
l
,
estate
->
es_rowMark
)
{
execRowMark
*
erm
=
lfirst
(
l
);
Buffer
buffer
;
HeapTupleData
tuple
;
TupleTableSlot
*
newSlot
;
int
test
;
lmark:
;
foreach
(
l
,
estate
->
es_rowMark
)
{
erm
=
lfirst
(
l
);
if
(
!
ExecGetJunkAttribute
(
junkfilter
,
slot
,
erm
->
resname
,
...
...
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