Don’t include empty/deleted values from KV storage

When looping over a range of KV items, it should ignore items which have been set to NULL and whose latest version has therefore been deleted.
This commit is contained in:
Tobie Morgan Hitchcock 2018-04-15 01:37:23 +01:00
parent 49ec33987f
commit 55ece805e4

View file

@ -114,7 +114,9 @@ func many(res *sql.Rows, err error) ([]kvs.KV, error) {
if err != nil {
return nil, &kvs.DBError{}
}
out = append(out, kv)
if kv.val != nil {
out = append(out, kv)
}
}
if err = res.Err(); err != nil {