File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -79,11 +79,12 @@ go_test(
79
79
"sample_test.go" ,
80
80
"scalar_test.go" ,
81
81
"statistics_test.go" ,
82
+ "table_test.go" ,
82
83
],
83
84
data = glob (["testdata/**" ]),
84
85
embed = [":statistics" ],
85
86
flaky = True ,
86
- shard_count = 37 ,
87
+ shard_count = 38 ,
87
88
deps = [
88
89
"//pkg/config" ,
89
90
"//pkg/meta/model" ,
Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ func (m *ColAndIdxExistenceMap) ColNum() int {
163
163
// Clone deeply copies the map.
164
164
func (m * ColAndIdxExistenceMap ) Clone () * ColAndIdxExistenceMap {
165
165
mm := NewColAndIndexExistenceMap (len (m .colAnalyzed ), len (m .idxAnalyzed ))
166
+ mm .checked = m .checked
166
167
mm .colAnalyzed = maps .Clone (m .colAnalyzed )
167
168
mm .idxAnalyzed = maps .Clone (m .idxAnalyzed )
168
169
return mm
Original file line number Diff line number Diff line change
1
+ // Copyright 2025 PingCAP, Inc.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ package statistics
16
+
17
+ import (
18
+ "testing"
19
+
20
+ "github.com/stretchr/testify/require"
21
+ )
22
+
23
+ func TestCloneColAndIdxExistenceMap (t * testing.T ) {
24
+ m := NewColAndIndexExistenceMapWithoutSize ()
25
+ m .InsertCol (1 , true )
26
+ m .InsertIndex (1 , true )
27
+ m .SetChecked ()
28
+
29
+ m2 := m .Clone ()
30
+ require .Equal (t , m , m2 )
31
+ }
You can’t perform that action at this time.
0 commit comments