Skip to content

Commit

Permalink
Merge #40215
Browse files Browse the repository at this point in the history
40215: workload/bank: reset payload column before reuse r=ajkr a=ajkr

Without this change, running the bank workload on a non-trivial number
of rows causes cockroach to fail with this error message:

`panic: cannot overwrite value on flat Bytes: maxSetIndex=999, setIndex=0, consider using Reset`

Release note: None

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
  • Loading branch information
craig[bot] and ajkr committed Aug 26, 2019
2 parents 7da3121 + 466fb1a commit 07bc600
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/workload/bank/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ func (b *bank) Tables() []workload.Table {
idCol := cb.ColVec(0).Int64()
balanceCol := cb.ColVec(1).Int64()
payloadCol := cb.ColVec(2).Bytes()
// coldata.Bytes only allows appends so we have to reset it
payloadCol.Reset()
for rowIdx := rowBegin; rowIdx < rowEnd; rowIdx++ {
var payload []byte
*a, payload = a.Alloc(b.payloadBytes, 0 /* extraCap */)
Expand Down

0 comments on commit 07bc600

Please sign in to comment.