Skip to content

Commit e1e23e4

Browse files
committed
rm nil check in since it uses a map
1 parent 327b11d commit e1e23e4

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

enginetest/queries/script_queries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ var ScriptTests = []ScriptTest{
132132
Assertions: []ScriptTestAssertion{
133133
{
134134
// LIMIT 0 causes the iterator to close without ever calling Next() on groupByIter
135-
// This leaves all buffer elements as nil, causing panic in Dispose()
135+
// This leaves all buffer elements as nil causing panic in Dispose(), or empty depending data struct
136136
Query: "SELECT category, SUM(value) FROM test_table GROUP BY category LIMIT 0",
137137
Expected: []sql.Row{},
138138
},

sql/rowexec/agg.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ func (i *groupByGroupingIter) Dispose() {
236236
bs, _ := i.get(k)
237237
if bs != nil {
238238
for _, b := range bs {
239-
if b != nil {
240-
b.Dispose()
241-
}
239+
b.Dispose()
242240
}
243241
}
244242
}

0 commit comments

Comments
 (0)