diff --git a/pkg/statistics/handle/handle_hist.go b/pkg/statistics/handle/handle_hist.go index 9a4feec5d6968..fea3974366945 100644 --- a/pkg/statistics/handle/handle_hist.go +++ b/pkg/statistics/handle/handle_hist.go @@ -368,9 +368,9 @@ func (*Handle) readStatsForOneItem(sctx sessionctx.Context, item model.TableItem return nil, errors.Trace(err) } if len(rows) == 0 { - logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, ", zap.Int64("table_id", item.TableID), + logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` ", zap.Int64("table_id", item.TableID), zap.Int64("hist_id", item.ID), zap.Bool("is_index", item.IsIndex)) - return nil, errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, , table_id:%v, hist_id:%v, is_index:%v", item.TableID, item.ID, item.IsIndex)) + return nil, errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` , table_id:%v, hist_id:%v, is_index:%v", item.TableID, item.ID, item.IsIndex)) } statsVer := rows[0].GetInt64(0) if item.IsIndex { diff --git a/pkg/statistics/handle/storage/read.go b/pkg/statistics/handle/storage/read.go index 10912db7c1651..a4903f38c5e42 100644 --- a/pkg/statistics/handle/storage/read.go +++ b/pkg/statistics/handle/storage/read.go @@ -540,8 +540,8 @@ func loadNeededColumnHistograms(sctx sessionctx.Context, statsCache util.StatsCa return errors.Trace(err) } if len(rows) == 0 { - logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, ", zap.Int64("table_id", col.TableID), zap.Int64("column_id", col.ID)) - return errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, , table_id:%v, column_id:%v", col.TableID, col.ID)) + logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` ", zap.Int64("table_id", col.TableID), zap.Int64("column_id", col.ID)) + return errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` , table_id:%v, column_id:%v", col.TableID, col.ID)) } statsVer := rows[0].GetInt64(0) colHist := &statistics.Column{ @@ -608,8 +608,8 @@ func loadNeededIndexHistograms(sctx sessionctx.Context, statsCache util.StatsCac return errors.Trace(err) } if len(rows) == 0 { - logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, ", zap.Int64("table_id", idx.TableID), zap.Int64("index_id", idx.ID)) - return errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram`, , table_id:%v, index_id:%v", idx.TableID, idx.ID)) + logutil.BgLogger().Error("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` ", zap.Int64("table_id", idx.TableID), zap.Int64("index_id", idx.ID)) + return errors.Trace(fmt.Errorf("fail to get stats version for this histogram, normally this wouldn't happen, please check if this column or index has a histogram record in `mysql.stats_histogram` , table_id:%v, index_id:%v", idx.TableID, idx.ID)) } idxHist := &statistics.Index{Histogram: *hg, CMSketch: cms, TopN: topN, FMSketch: fms, Info: index.Info, StatsVer: rows[0].GetInt64(0),