From 539fde5e51478bb7ab6153c8a0866f5d2ceccf16 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Wed, 16 Oct 2024 18:24:16 +0800 Subject: [PATCH] update Signed-off-by: Weizhen Wang --- pkg/statistics/histogram.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/statistics/histogram.go b/pkg/statistics/histogram.go index 9d4754a3bf23c..c9005accbe5bd 100644 --- a/pkg/statistics/histogram.go +++ b/pkg/statistics/histogram.go @@ -1545,7 +1545,7 @@ func MergePartitionHist2GlobalHist(sc *stmtctx.StatementContext, hists []*Histog // Calc the bucket lower. if minValue == nil || len(globalBuckets) == 0 { // both hists and popedTopN are empty, returns an empty hist in this case - if len(globalBuckets) == 0 { + if len(hists) == 0 { logutil.BgLogger().Info("debug info for MergePartitionHist2GlobalHist") } return NewHistogram(hists[0].ID, 0, totNull, hists[0].LastUpdateVersion, hists[0].Tp, len(globalBuckets), totColSize), nil