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

Commite243de0

Browse files
committed
amcheck: Fix incorrect use of VARATT_IS_COMPRESSED.
The macro is being applied to a TOAST pointer, not a varlena header.Therefore the use of VARATT_IS_COMPRESSED() is wrong. We can checkVARATT_EXTERNAL_IS_COMPRESSED(), but then we don't need the lengthcheck that follows.Report and fix by Kyotaro Horiguchi.Discussion:http://postgr.es/m/20220517.162719.1671558681467343711.horikyota.ntt@gmail.com
1 parent9f0b953 commite243de0

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

‎contrib/amcheck/verify_heapam.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,19 +1385,11 @@ check_tuple_attribute(HeapCheckContext *ctx)
13851385
toast_pointer.va_rawsize,
13861386
VARLENA_SIZE_LIMIT));
13871387

1388-
if (VARATT_IS_COMPRESSED(&toast_pointer))
1388+
if (VARATT_EXTERNAL_IS_COMPRESSED(toast_pointer))
13891389
{
13901390
ToastCompressionIdcmid;
13911391
boolvalid= false;
13921392

1393-
/* Compression should never expand the attribute */
1394-
if (VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer)>toast_pointer.va_rawsize-VARHDRSZ)
1395-
report_corruption(ctx,
1396-
psprintf("toast value %u external size %u exceeds maximum expected for rawsize %d",
1397-
toast_pointer.va_valueid,
1398-
VARATT_EXTERNAL_GET_EXTSIZE(toast_pointer),
1399-
toast_pointer.va_rawsize));
1400-
14011393
/* Compressed attributes should have a valid compression method */
14021394
cmid=TOAST_COMPRESS_METHOD(&toast_pointer);
14031395
switch (cmid)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp