Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited845c7

Browse files
committed
Fix relcache refcount leakage when inv_drop is applied
to a non-LO relation.
1 parentf0a2fc3 commited845c7

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

‎src/backend/storage/large_object/inv_api.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.65 2000/01/26 05:56:59 momjian Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/storage/large_object/inv_api.c,v 1.66 2000/04/08 04:37:07 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -278,10 +278,20 @@ inv_drop(Oid lobjId)
278278
{
279279
Relationr;
280280

281-
r=(Relation)RelationIdGetRelation(lobjId);
282-
if (!RelationIsValid(r)||r->rd_rel->relkind!=RELKIND_LOBJECT)
281+
r=RelationIdGetRelation(lobjId);
282+
if (!RelationIsValid(r))
283283
return-1;
284284

285+
if (r->rd_rel->relkind!=RELKIND_LOBJECT)
286+
{
287+
/* drop relcache refcount from RelationIdGetRelation */
288+
RelationDecrementReferenceCount(r);
289+
return-1;
290+
}
291+
292+
/* Since heap_drop_with_catalog will destroy the relcache entry,
293+
* there's no need to drop the refcount in this path.
294+
*/
285295
heap_drop_with_catalog(RelationGetRelationName(r));
286296
return1;
287297
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp