diff --git a/pkg/executor/internal/vecgroupchecker/BUILD.bazel b/pkg/executor/internal/vecgroupchecker/BUILD.bazel index ba5fce361b700..3a143a8cf4ace 100644 --- a/pkg/executor/internal/vecgroupchecker/BUILD.bazel +++ b/pkg/executor/internal/vecgroupchecker/BUILD.bazel @@ -22,7 +22,7 @@ go_test( ], embed = [":vecgroupchecker"], flaky = True, - shard_count = 3, + shard_count = 4, deps = [ "//pkg/config", "//pkg/expression", diff --git a/pkg/executor/internal/vecgroupchecker/vec_group_checker.go b/pkg/executor/internal/vecgroupchecker/vec_group_checker.go index 056ee8a478032..abb070420254e 100644 --- a/pkg/executor/internal/vecgroupchecker/vec_group_checker.go +++ b/pkg/executor/internal/vecgroupchecker/vec_group_checker.go @@ -496,6 +496,7 @@ func (e *VecGroupChecker) IsExhausted() bool { func (e *VecGroupChecker) Reset() { if e.groupOffset != nil { e.groupOffset = e.groupOffset[:0] + e.groupCount = 0 } if e.sameGroup != nil { e.sameGroup = e.sameGroup[:0] diff --git a/pkg/executor/internal/vecgroupchecker/vec_group_checker_test.go b/pkg/executor/internal/vecgroupchecker/vec_group_checker_test.go index cbb2ec240b395..df9559eaea3c1 100644 --- a/pkg/executor/internal/vecgroupchecker/vec_group_checker_test.go +++ b/pkg/executor/internal/vecgroupchecker/vec_group_checker_test.go @@ -268,3 +268,13 @@ func TestVecGroupChecker(t *testing.T) { require.Equal(t, e, 3) require.True(t, groupChecker.IsExhausted()) } + +func TestIssue53867(t *testing.T) { + checker := NewVecGroupChecker(nil, true, nil) + checker.groupOffset = make([]int, 20) + checker.nextGroupID = 10 + checker.groupCount = 15 + require.False(t, checker.IsExhausted()) + checker.Reset() + require.True(t, checker.IsExhausted()) +}