mirror of
https://github.com/minio/minio.git
synced 2025-11-13 15:21:36 -05:00
committed by
Harshavardhana
parent
4155f4e49b
commit
1c5b05c130
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user