From 8db81ede9938b07d9ff24d8b4e6ce1a1d31b5580 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Fri, 22 Dec 2023 16:16:55 +0800 Subject: [PATCH] executor: remove bce in the AnalyzeColumnsExec (#49703) close pingcap/tidb#49704 --- pkg/executor/analyze_col.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/executor/analyze_col.go b/pkg/executor/analyze_col.go index 4c6f24c73f38c..99f9af2b44c76 100644 --- a/pkg/executor/analyze_col.go +++ b/pkg/executor/analyze_col.go @@ -249,15 +249,15 @@ func (e *AnalyzeColumnsExec) buildStats(ranges []*ranger.Range, needExtStats boo topNs = append(topNs, collectors[i].TopN) } for j, s := range collectors[i].Samples { - collectors[i].Samples[j].Ordinal = j - collectors[i].Samples[j].Value, err = tablecodec.DecodeColumnValue(s.Value.GetBytes(), &col.FieldType, timeZone) + s.Ordinal = j + s.Value, err = tablecodec.DecodeColumnValue(s.Value.GetBytes(), &col.FieldType, timeZone) if err != nil { return nil, nil, nil, nil, nil, err } // When collation is enabled, we store the Key representation of the sampling data. So we set it to kind `Bytes` here // to avoid to convert it to its Key representation once more. - if collectors[i].Samples[j].Value.Kind() == types.KindString { - collectors[i].Samples[j].Value.SetBytes(collectors[i].Samples[j].Value.GetBytes()) + if s.Value.Kind() == types.KindString { + s.Value.SetBytes(s.Value.GetBytes()) } } var hg *statistics.Histogram