Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Apr 30, 2024
1 parent 165dde0 commit 2ace0f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pkg/planner/core/common_unity.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
context2 "context"
"encoding/json"
"fmt"
"github.com/pingcap/tidb/pkg/util/intest"
"strings"

"github.com/pingcap/tidb/pkg/expression"
Expand Down Expand Up @@ -176,10 +175,6 @@ func fillUpStats(result map[string]*UnityTableInfo) {
col.Min = buckets[0].Lower
col.Max = buckets[len(buckets)-1].Upper
}

if intest.InTest {
col.Histogram = []UnityHistBucket{}
}
}
for idxName, idx := range tblInfo.Indexes {
idxStats := tblStats.Indices[tblInfo.idx2id[idxName]]
Expand Down
7 changes: 7 additions & 0 deletions pkg/planner/core/common_unity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ func formatPrint(tk *testkit.TestKit, sql string) {
if err := json.Unmarshal([]byte(jsonData), &j); err != nil {
panic(err)
}

for _, t := range j.Tables {
for _, c := range t.Columns {
c.Histogram = []core.UnityHistBucket{}
}
}

v, err := json.MarshalIndent(j, "", " ")
if err != nil {
panic(err)
Expand Down

0 comments on commit 2ace0f9

Please sign in to comment.