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

Commit9f4f0a0

Browse files
committed
Fix incorrect logic in HaveRegisteredOrActiveSnapshot().
This function gave the wrong answer when there's more than oneRegisteredSnapshots entry, whether or not any of them is theCatalogSnapshot. This leads to assertion failure in some scenariosinvolving fetching toasted data using a cursor. (As per discussion,I'm dubious that this is the right contract to be enforcing at all;but it surely doesn't help to be enforcing it incorrectly.)Fetching toasted data using a cursor is evidently under-tested,so add a test case too.Per report from Erik Rijkers. This is new code, so no need forback-patch.Discussion:https://postgr.es/m/dc9dd229-ed30-6c62-4c41-d733ffff776b@xs4all.nl
1 parenta17fd67 commit9f4f0a0

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1646,11 +1646,11 @@ HaveRegisteredOrActiveSnapshot(void)
16461646
* removed at any time due to invalidation processing. If explicitly
16471647
* registered more than one snapshot has to be in RegisteredSnapshots.
16481648
*/
1649-
if (pairingheap_is_empty(&RegisteredSnapshots)||
1650-
!pairingheap_is_singular(&RegisteredSnapshots))
1649+
if (CatalogSnapshot!=NULL&&
1650+
pairingheap_is_singular(&RegisteredSnapshots))
16511651
return false;
16521652

1653-
returnCatalogSnapshot==NULL;
1653+
return!pairingheap_is_empty(&RegisteredSnapshots);
16541654
}
16551655

16561656

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp