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

Commit96c702c

Browse files
committed
Remove dead code in toast_fetch_datum_slice
In toast_fetch_datum_slice(), we Assert() that what is passed in isn'tcompressed, but we then later had a check to see what the length of ifwhat was passed in is compressed. That later check is rather confusingsince toast_fetch_datum_slice() is only ever called with non-compresseddatums and the Assert() earlier makes it clear that one shouldn't bepassing in compressed datums.Add a comment to make it clear that toast_fetch_datum_slice() is justfor non-compressed datums, and remove the dead code.
1 parent6d8727f commit96c702c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎src/backend/access/heap/tuptoaster.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,8 @@ toast_fetch_datum(struct varlena *attr)
20262026
*
20272027
*Reconstruct a segment of a Datum from the chunks saved
20282028
*in the toast relation
2029+
*
2030+
*Note that this function only supports non-compressed external datums.
20292031
* ----------
20302032
*/
20312033
staticstructvarlena*
@@ -2085,10 +2087,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length)
20852087

20862088
result= (structvarlena*)palloc(length+VARHDRSZ);
20872089

2088-
if (VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer))
2089-
SET_VARSIZE_COMPRESSED(result,length+VARHDRSZ);
2090-
else
2091-
SET_VARSIZE(result,length+VARHDRSZ);
2090+
SET_VARSIZE(result,length+VARHDRSZ);
20922091

20932092
if (length==0)
20942093
returnresult;/* Can save a lot of work at this point! */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp