sqliteclidriver: clear content from ret if sentinel was found

This commit is contained in:
mappu 2024-06-30 12:51:05 +12:00
parent 5c44dc5f54
commit 0866e5edac

View File

@ -286,7 +286,13 @@ func (s *SCStmt) Query(args []driver.Value) (driver.Rows, error) {
} }
} }
if !wasSentinel { if wasSentinel {
// There was no data.
// Wipe out `ret`
ret = nil
} else {
// There was data.
// Need to decode again (from the same decoder reader) until we find the sentinel // Need to decode again (from the same decoder reader) until we find the sentinel
surplus := []map[string]any{} surplus := []map[string]any{}
err = decoder.Decode(&surplus) err = decoder.Decode(&surplus)