Skip to content

Commit

Permalink
chunk: add clear in RowContainer (pingcap#14499)
Browse files Browse the repository at this point in the history
  • Loading branch information
ichn-hu authored and sre-bot committed Jan 17, 2020
1 parent 4cf5e7d commit 3a1b5b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBm
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44 h1:tB9NOR21++IjLyVx3/PCPhWMwqGNCMQEH96A6dMZ/gc=
github.com/sergi/go-diff v1.0.1-0.20180205163309-da645544ed44/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shirou/gopsutil v2.19.10+incompatible h1:lA4Pi29JEVIQIgATSeftHSY0rMGI9CLrl2ZvDLiahto=
github.com/shirou/gopsutil v2.19.10+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
Expand Down
1 change: 1 addition & 0 deletions util/chunk/row_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func (c *RowContainer) Close() (err error) {
err = c.recordsInDisk.Close()
c.recordsInDisk = nil
}
c.records.Clear()
return
}

Expand Down
2 changes: 2 additions & 0 deletions util/chunk/row_container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (r *rowContainerTestSuite) TestSel(c *check.C) {
checkByIter(NewMultiIterator(NewIterator4RowContainer(rc), NewIterator4Chunk(chk)))
err = rc.Close()
c.Assert(err, check.IsNil)
c.Assert(rc.memTracker.BytesConsumed(), check.Equals, int64(0))
c.Assert(rc.memTracker.MaxConsumed(), check.Greater, int64(0))
}

func (r *rowContainerTestSuite) TestSpillAction(c *check.C) {
Expand Down

0 comments on commit 3a1b5b2

Please sign in to comment.