S3 select: Fix output conversion on select * (#8303)

Fixes #8268
This commit is contained in:
Klaus Post
2019-09-27 12:33:14 -07:00
committed by Harshavardhana
parent 4155f4e49b
commit 1c5b05c130
6 changed files with 78 additions and 29 deletions

View File

@@ -58,15 +58,17 @@ func (r *Record) Reset() {
}
}
// CopyFrom will copy all records from the incoming and append them to the existing records.
// The source record must be of a similar type.
func (r *Record) CopyFrom(record sql.Record) error {
other, ok := record.(*Record)
// Clone the record and if possible use the destination provided.
func (r *Record) Clone(dst sql.Record) sql.Record {
other, ok := dst.(*Record)
if !ok {
return fmt.Errorf("unexpected record type, expected %T, got %T", r, record)
other = &Record{}
}
r.KVS = append(r.KVS, other.KVS...)
return nil
if len(other.KVS) > 0 {
other.KVS = other.KVS[:0]
}
other.KVS = append(other.KVS, r.KVS...)
return other
}
// Set - sets the value for a column name.