Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit c7ed42c

Browse files
authored
Merge pull request #1577 from grafana/update-gocql-again
update gocql to 1982a06ad6b987c24beec15336019914d71b2e31
2 parents ca0897f + cb83a93 commit c7ed42c

28 files changed

+3299
-1113
lines changed

Gopkg.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gopkg.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ unused-packages = true
6363

6464
[[constraint]]
6565
name = "github.com/gocql/gocql"
66-
revision = "d9815cdf0ff24e2efa9b8062f4f94a6dd347ae51"
66+
revision = "1982a06ad6b987c24beec15336019914d71b2e31"
6767

6868
[[constraint]]
6969
name = "github.com/golang/snappy"

cmd/mt-store-cp-experimental/main.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,10 @@ func worker(id int, jobs <-chan string, wg *sync.WaitGroup, sourceSession, destS
280280
if *verbose {
281281
log.Printf("id=%d processing rownum=%d table=%q key=%q ts=%d query=%q data='%x'\n", id, atomic.LoadUint64(&doneRows)+1, tableIn, key, ts, query, data)
282282
}
283-
284-
batch.Query(insertQuery, data, key, ts, ttl)
283+
// As 'data' is re-used for each scan, we need to make a copy of the []byte slice before assigning it to a new batch.
284+
safeData := make([]byte, len(data))
285+
copy(safeData, data)
286+
batch.Query(insertQuery, safeData, key, ts, ttl)
285287

286288
if batch.Size() >= *maxBatchSize {
287289
if *verbose {

store/cassandra/cassandra.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,10 @@ func (c *CassandraStore) SearchTable(ctx context.Context, key schema.AMKey, tabl
533533
if len(b) < 2 {
534534
return itgens, errChunkTooSmall
535535
}
536-
itgen, err := chunk.NewIterGen(uint32(t0), intervalHint, b)
536+
// As 'b' is re-used for each scan, we need to make a copy of the []byte slice before assigning it to a new IterGen.
537+
safeBytes := make([]byte, len(b))
538+
copy(safeBytes, b)
539+
itgen, err := chunk.NewIterGen(uint32(t0), intervalHint, safeBytes)
537540
if err != nil {
538541
return itgens, err
539542
}

vendor/github.com/gocql/gocql/AUTHORS

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/gocql/gocql/cluster.go

+50-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)