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

Commit5184f11

Browse files
committed
Fix bad formula in previous commit.
Commitd5406de used a slightlynovel, and wrong, approach to compute the length of the lasttoast chunk. It worked fine unless the last chunk happened tohave the largest possible size.
1 parentd5406de commit5184f11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/access/common/detoast.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ toast_fetch_datum(struct varlena *attr)
443443
toast_pointer.va_valueid,
444444
RelationGetRelationName(toastrel))));
445445
expected_size=curchunk<totalchunks-1 ?TOAST_MAX_CHUNK_SIZE
446-
:attrsize%TOAST_MAX_CHUNK_SIZE;
446+
:attrsize- ((totalchunks-1)*TOAST_MAX_CHUNK_SIZE);
447447
if (chunksize!=expected_size)
448448
ereport(ERROR,
449449
(errcode(ERRCODE_DATA_CORRUPTED),
@@ -676,7 +676,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset,
676676
toast_pointer.va_valueid,
677677
RelationGetRelationName(toastrel))));
678678
expected_size=curchunk<totalchunks-1 ?TOAST_MAX_CHUNK_SIZE
679-
:attrsize%TOAST_MAX_CHUNK_SIZE;
679+
:attrsize- ((totalchunks-1)*TOAST_MAX_CHUNK_SIZE);
680680
if (chunksize!=expected_size)
681681
ereport(ERROR,
682682
(errcode(ERRCODE_DATA_CORRUPTED),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp