e3: don't loose nil-value in reconstitution (#7117)

This commit is contained in:
Alex Sharov 2023-03-16 10:27:09 +07:00 committed by GitHub
parent 157a380be7
commit 60fb9c12e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1213,7 +1213,11 @@ func reconstituteStep(last bool,
}
lastKey = append(lastKey[:0], k[:len(k)-8]...)
}
lastVal = append(lastVal[:0], v...)
if v == nil { // `nil` value means delete, `empty value []byte{}` means empty value
lastVal = nil
} else {
lastVal = append(lastVal[:0], v...)
}
return nil
}, etl.TransformArgs{}); err != nil {
return err
@ -1241,7 +1245,11 @@ func reconstituteStep(last bool,
}
lastKey = append(lastKey[:0], k[:len(k)-8]...)
}
lastVal = append(lastVal[:0], v...)
if v == nil {
lastVal = nil
} else {
lastVal = append(lastVal[:0], v...)
}
return nil
}, etl.TransformArgs{}); err != nil {
return err
@ -1269,7 +1277,11 @@ func reconstituteStep(last bool,
}
lastKey = append(lastKey[:0], k[:len(k)-8]...)
}
lastVal = append(lastVal[:0], v...)
if v == nil {
lastVal = nil
} else {
lastVal = append(lastVal[:0], v...)
}
return nil
}, etl.TransformArgs{}); err != nil {
return err