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

Commit3acca18

Browse files
committed
Fix ancient memory leak in index_create(): RelationInitIndexAccessInfo
was being called twice in normal operation, leading to a leak of one setof relcache subsidiary info. Per report from Jeff Gold.
1 parent252600f commit3acca18

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

‎src/backend/catalog/index.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.257 2005/06/20 02:07:47 neilc Exp $
11+
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.258 2005/06/25 16:53:49 tgl Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -704,13 +704,21 @@ index_create(Oid heapRelationId,
704704
}
705705

706706
/*
707-
* Fill in the index strategy structure with information from the
708-
* catalogs. First we must advance the command counter so that we
709-
* will see the newly-entered index catalog tuples.
707+
* Advance the command counter so that we can see the newly-entered
708+
* catalog tuples for the index.
710709
*/
711710
CommandCounterIncrement();
712711

713-
RelationInitIndexAccessInfo(indexRelation);
712+
/*
713+
* In bootstrap mode, we have to fill in the index strategy structure
714+
* with information from the catalogs. If we aren't bootstrapping,
715+
* then the relcache entry has already been rebuilt thanks to sinval
716+
* update during CommandCounterIncrement.
717+
*/
718+
if (IsBootstrapProcessingMode())
719+
RelationInitIndexAccessInfo(indexRelation);
720+
else
721+
Assert(indexRelation->rd_indexcxt!=NULL);
714722

715723
/*
716724
* If this is bootstrap (initdb) time, then we don't actually fill in

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp