Skip to content

Commit

Permalink
fix(embedded/sql): fix data-race when mapping keys
Browse files Browse the repository at this point in the history
Signed-off-by: Jeronimo Irazabal <[email protected]>
  • Loading branch information
jeroiraz committed Nov 3, 2023
1 parent 8ff8643 commit 033662e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions embedded/sql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ func indexEntryMapperFor(index, primaryIndex *Index) store.EntryMapper {
return nil
}

encodedValues := make([][]byte, 2+len(index.cols)+1)
encodedValues[0] = EncodeID(index.table.id)
encodedValues[1] = EncodeID(index.id)

return func(key, value []byte) ([]byte, error) {
encodedValues := make([][]byte, 2+len(index.cols)+1)
encodedValues[0] = EncodeID(index.table.id)
encodedValues[1] = EncodeID(index.id)

valuesByColID := make(map[uint32]TypedValue, len(index.cols))

for _, col := range index.table.cols {
Expand Down

0 comments on commit 033662e

Please sign in to comment.