Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
93868: colexec: fix range stats operator with the selection vector r=yuzefovich a=yuzefovich Previously, if the input batch had a selection vector set, we could get an index out of bounds internal error because we would iterate up to the length of the selection vector which can exceed the length of the batch. Note that in practice this should be very rare to hit - generally speaking, the selection vector has the same length as all of the vectors in the batch. I couldn't reproduce the problem when using `demo`, so there is no regression test. Introduction of unit tests that use powerful `RunTests` test harness (that might have caught this bug) is left as a TODO. Fixes: cockroachdb#93806. Release note (bug fix): CockroachDB could previously, in rare cases, encounter an internal error when evaluating `crdb_internal.range_stats` builtin (which powers `SHOW RANGES` command among other things). The bug was introduced in 22.2.0 and is now fixed. Co-authored-by: Yahor Yuzefovich <[email protected]>
- Loading branch information