Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 0186d36

Browse files
authored
Merge pull request ClickHouse#328 from dgrr/master
Fix ClickHouse#327
2 parents 41a0f96 + 08ccc69 commit 0186d36

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/data/block.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ func (block *Block) Reserve() {
175175
func (block *Block) Reset() {
176176
block.NumRows = 0
177177
block.NumColumns = 0
178+
block.Values = block.Values[:0]
179+
block.Columns = block.Columns[:0]
180+
block.info.reset()
178181
for _, buffer := range block.buffers {
179182
buffer.reset()
180183
}
@@ -223,6 +226,14 @@ type blockInfo struct {
223226
num3 uint64
224227
}
225228

229+
func (info *blockInfo) reset() {
230+
info.num1 = 0
231+
info.isOverflows = false
232+
info.num2 = 0
233+
info.bucketNum = 0
234+
info.num3 = 0
235+
}
236+
226237
func (info *blockInfo) read(decoder *binary.Decoder) error {
227238
var err error
228239
if info.num1, err = decoder.Uvarint(); err != nil {

0 commit comments

Comments
 (0)