From 603cf2a8bbdba128adb593c3778952f934344588 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 12 Mar 2020 15:34:11 -0700 Subject: [PATCH] fix: broken gzip handling with Select API (#9128) This PR fixes a regression introduced in a1c7c9ea73d7cb563156f4a6278d4ac66b9fe34c --- pkg/s3select/progress.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/s3select/progress.go b/pkg/s3select/progress.go index 00d9afd4a..df68163fd 100644 --- a/pkg/s3select/progress.go +++ b/pkg/s3select/progress.go @@ -100,12 +100,13 @@ func newProgressReader(rc io.ReadCloser, compType CompressionType) (*progressRea case noneType: r = scannedReader case gzipType: - if r, err = gzip.NewReader(scannedReader); err != nil { + r, err = gzip.NewReader(scannedReader) + if err != nil { if errors.Is(err, gzip.ErrHeader) || errors.Is(err, gzip.ErrChecksum) { return nil, errInvalidGZIPCompressionFormat(err) } + return nil, errTruncatedInput(err) } - return nil, errTruncatedInput(err) case bzip2Type: r = bzip2.NewReader(scannedReader) default: