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

Commitee57892

Browse files
committed
smgr: Make SMgrRelation initialization safer against errors
In case the smgr_open callback failed, the ->pincount field would not beinitialized and the relation would not be put onto the unpinned_relns list.This buglet was introduced in21d9c3e, in 17.Discussion:https://postgr.es/m/3vae7l5ozvqtxmd7rr7zaeq3qkuipz365u3rtim5t5wdkr6f4g@vkgf2fogjirlBackpatch-through: 17
1 parent09ef2f8 commitee57892

File tree

1 file changed

+3
-3
lines changed
  • src/backend/storage/smgr

1 file changed

+3
-3
lines changed

‎src/backend/storage/smgr/smgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,12 @@ smgropen(RelFileLocator rlocator, ProcNumber backend)
231231
reln->smgr_cached_nblocks[i]=InvalidBlockNumber;
232232
reln->smgr_which=0;/* we only have md.c at present */
233233

234-
/* implementation-specific initialization */
235-
smgrsw[reln->smgr_which].smgr_open(reln);
236-
237234
/* it is not pinned yet */
238235
reln->pincount=0;
239236
dlist_push_tail(&unpinned_relns,&reln->node);
237+
238+
/* implementation-specific initialization */
239+
smgrsw[reln->smgr_which].smgr_open(reln);
240240
}
241241

242242
returnreln;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp