Skip to content

Commit

Permalink
colexecbase: fix a recently introduced bug with identity cast
Browse files Browse the repository at this point in the history
This commit fixes a recently introduced bug that can occur when we're
randomizing `coldata.BatchSize()` (which we do in tests). In particular,
we capped a global singleton at one batch size value, but later we can
change it to a higher value, which could lead to index out of bounds.
This is now fixed by always using the max batch size.

Release note: None
  • Loading branch information
yuzefovich committed Mar 15, 2023
1 parent f8ca1e6 commit e8fd9a9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/sql/colexec/colexecbase/cast.eg.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/sql/colexec/colexecbase/cast_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ var _ colexecop.ClosableOperator = &castIdentityOp{}
var identityOrder []int

func init() {
identityOrder = make([]int, coldata.BatchSize())
identityOrder = make([]int, coldata.MaxBatchSize)
for i := range identityOrder {
identityOrder[i] = i
}
Expand Down

0 comments on commit e8fd9a9

Please sign in to comment.