mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 22:10:45 -04:00
Fix bad formula in previous commit.
Commit d5406dea25 used a slightly
novel, and wrong, approach to compute the length of the last
toast chunk. It worked fine unless the last chunk happened to
have the largest possible size.
This commit is contained in:
parent
d5406dea25
commit
5184f110aa
1 changed files with 2 additions and 2 deletions
|
|
@ -443,7 +443,7 @@ toast_fetch_datum(struct varlena *attr)
|
|||
toast_pointer.va_valueid,
|
||||
RelationGetRelationName(toastrel))));
|
||||
expected_size = curchunk < totalchunks - 1 ? TOAST_MAX_CHUNK_SIZE
|
||||
: attrsize % TOAST_MAX_CHUNK_SIZE;
|
||||
: attrsize - ((totalchunks - 1) * TOAST_MAX_CHUNK_SIZE);
|
||||
if (chunksize != expected_size)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
|
|
@ -676,7 +676,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset,
|
|||
toast_pointer.va_valueid,
|
||||
RelationGetRelationName(toastrel))));
|
||||
expected_size = curchunk < totalchunks - 1 ? TOAST_MAX_CHUNK_SIZE
|
||||
: attrsize % TOAST_MAX_CHUNK_SIZE;
|
||||
: attrsize - ((totalchunks - 1) * TOAST_MAX_CHUNK_SIZE);
|
||||
if (chunksize != expected_size)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_DATA_CORRUPTED),
|
||||
|
|
|
|||
Loading…
Reference in a new issue