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

Commit4f9f495

Browse files
committed
Fix crash bug in RestoreSnapshot.
If serialized_snapshot->subxcnt > 0 and serialized_snapshot->xcnt == 0,the old coding would do the wrong thing and crash. This can happenon standby servers.Report by Andreas Seltenreich. Patch by Thomas Munro, reviewed byAmit Kapila and tested by Andreas Seltenreich.
1 parent10c0558 commit4f9f495

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/utils/time/snapmgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,8 @@ RestoreSnapshot(char *start_address)
20162016
/* Copy SubXIDs, if present. */
20172017
if (serialized_snapshot->subxcnt>0)
20182018
{
2019-
snapshot->subxip=snapshot->xip+serialized_snapshot->xcnt;
2019+
snapshot->subxip= ((TransactionId*) (snapshot+1))+
2020+
serialized_snapshot->xcnt;
20202021
memcpy(snapshot->subxip,serialized_xids+serialized_snapshot->xcnt,
20212022
serialized_snapshot->subxcnt*sizeof(TransactionId));
20222023
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp