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

Commit499faf9

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 parent62d712e commit499faf9

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
@@ -234,12 +234,12 @@ smgropen(RelFileLocator rlocator, ProcNumber backend)
234234
reln->smgr_cached_nblocks[i]=InvalidBlockNumber;
235235
reln->smgr_which=0;/* we only have md.c at present */
236236

237-
/* implementation-specific initialization */
238-
smgrsw[reln->smgr_which].smgr_open(reln);
239-
240237
/* it is not pinned yet */
241238
reln->pincount=0;
242239
dlist_push_tail(&unpinned_relns,&reln->node);
240+
241+
/* implementation-specific initialization */
242+
smgrsw[reln->smgr_which].smgr_open(reln);
243243
}
244244

245245
returnreln;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp