From 466fb1a96962b600e1ba83e286538b59336baba2 Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Mon, 26 Aug 2019 11:32:36 -0700 Subject: [PATCH] workload/bank: reset payload column before reuse 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 --- pkg/workload/bank/bank.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/workload/bank/bank.go b/pkg/workload/bank/bank.go index c66ed1193518..2148149e6198 100644 --- a/pkg/workload/bank/bank.go +++ b/pkg/workload/bank/bank.go @@ -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 */)