mirror of
https://github.com/minio/minio.git
synced 2025-04-24 12:21:02 -04:00
do not panic when input cannot be parsed (#13791)
Fix cases where `s3Select.Open` fails and doesn't set the recordReader. Fixes #13786
This commit is contained in:
parent
5a22f2cf0b
commit
d6fe0f61a9
@ -369,7 +369,7 @@ func (s3Select *S3Select) Open(getReader func(offset, length int64) (io.ReadClos
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
panic(fmt.Errorf("unknown input format '%v'", s3Select.Input.format))
|
return fmt.Errorf("unknown input format '%v'", s3Select.Input.format)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s3Select *S3Select) marshal(buf *bytes.Buffer, record sql.Record) error {
|
func (s3Select *S3Select) marshal(buf *bytes.Buffer, record sql.Record) error {
|
||||||
@ -577,6 +577,9 @@ OuterLoop:
|
|||||||
|
|
||||||
// Close - closes opened S3 object.
|
// Close - closes opened S3 object.
|
||||||
func (s3Select *S3Select) Close() error {
|
func (s3Select *S3Select) Close() error {
|
||||||
|
if s3Select.recordReader == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return s3Select.recordReader.Close()
|
return s3Select.recordReader.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user