Skip to content

Commit

Permalink
*
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Jun 6, 2024
1 parent 882b9fa commit 7f6b0bb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion statistics/handle/handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/parser/model"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/session"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/statistics"
Expand Down Expand Up @@ -505,11 +506,20 @@ func TestInitStats(t *testing.T) {
require.Equal(t, uint8(0x36), cols[1].LastAnalyzePos.GetBytes()[0])
require.Equal(t, uint8(0x37), cols[2].LastAnalyzePos.GetBytes()[0])
require.Equal(t, uint8(0x38), cols[3].LastAnalyzePos.GetBytes()[0])
table1 := h.GetTableStats(tbl.Meta())
for _, column := range table1.Columns {
if mysql.HasPriKeyFlag(column.Info.GetFlag()) {
// primary key column has no stats info, because primary key's is_index is false. so it cannot load the topn
require.Nil(t, column.TopN)
}
require.False(t, column.IsFullLoad())
}
h.Clear()
require.NoError(t, h.Update(is))
table1 := h.GetTableStats(tbl.Meta())
table1 = h.GetTableStats(tbl.Meta())
assertTableEqual(t, table0, table1)
h.SetLease(0)

}

func TestInitStatsVer2(t *testing.T) {
Expand Down

0 comments on commit 7f6b0bb

Please sign in to comment.