Skip to content

Commit

Permalink
statistics: lite init used wrong value to build table stats ver (#58021)
Browse files Browse the repository at this point in the history
close #58020
  • Loading branch information
winoros authored Dec 6, 2024
1 parent 8c88823 commit 5de1105
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/statistics/handle/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (*Handle) initStatsHistograms4ChunkLite(cache statstypes.StatsCache, iter *
id := row.GetInt64(2)
ndv := row.GetInt64(3)
nullCount := row.GetInt64(5)
statsVer := row.GetInt64(7)
statsVer := row.GetInt64(8)
// All the objects in the table share the same stats version.
if statsVer != statistics.Version0 {
table.StatsVer = int(statsVer)
Expand Down
1 change: 1 addition & 0 deletions pkg/statistics/handle/handletest/handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1414,6 +1414,7 @@ func TestInitStatsLite(t *testing.T) {
require.NoError(t, h.InitStatsLite(context.Background()))
statsTbl1 := h.GetTableStats(tblInfo)
checkAllEvicted(t, statsTbl1)
require.Equal(t, int(statistics.Version2), statsTbl1.StatsVer)
{
// internal.AssertTableEqual(t, statsTbl0, statsTbl1)
// statsTbl0 is loaded when the cache has pseudo table.
Expand Down

0 comments on commit 5de1105

Please sign in to comment.