From 6c8f4a855bed1f5d2d2c72d6fc6caf3101340b09 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Fri, 7 Jun 2024 15:47:52 +0800 Subject: [PATCH 1/4] fix --- pkg/executor/internal/vecgroupchecker/vec_group_checker.go | 1 + 1 file changed, 1 insertion(+) 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] From 10c906b7944f8983468a747dc4d80b2e903f85c2 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 17 Jun 2024 19:08:04 +0800 Subject: [PATCH 2/4] create test file --- .../aggregate/agg_stream_executor_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 pkg/executor/aggregate/agg_stream_executor_test.go diff --git a/pkg/executor/aggregate/agg_stream_executor_test.go b/pkg/executor/aggregate/agg_stream_executor_test.go new file mode 100644 index 0000000000000..f3bbd7de442e6 --- /dev/null +++ b/pkg/executor/aggregate/agg_stream_executor_test.go @@ -0,0 +1,21 @@ +// Copyright 2024 PingCAP, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package aggregate_test + +import "testing" + +func TestIssue53867(t *testing.T) { + +} From baae5bb788f72651f399d97e2e579d7d266a36ac Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Mon, 17 Jun 2024 19:33:19 +0800 Subject: [PATCH 3/4] add test --- .../aggregate/agg_stream_executor_test.go | 21 ------------------- .../vecgroupchecker/vec_group_checker_test.go | 10 +++++++++ 2 files changed, 10 insertions(+), 21 deletions(-) delete mode 100644 pkg/executor/aggregate/agg_stream_executor_test.go diff --git a/pkg/executor/aggregate/agg_stream_executor_test.go b/pkg/executor/aggregate/agg_stream_executor_test.go deleted file mode 100644 index f3bbd7de442e6..0000000000000 --- a/pkg/executor/aggregate/agg_stream_executor_test.go +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2024 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package aggregate_test - -import "testing" - -func TestIssue53867(t *testing.T) { - -} 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()) +} From 276f486aaa5502fa1c84119a9869f7e7046779c4 Mon Sep 17 00:00:00 2001 From: xzhangxian1008 Date: Tue, 18 Jun 2024 10:51:43 +0800 Subject: [PATCH 4/4] update --- pkg/executor/internal/vecgroupchecker/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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",