From 21f30098a3d0fdb86f5a0a948053f43343c08719 Mon Sep 17 00:00:00 2001 From: yisaer Date: Tue, 10 Jan 2023 17:16:25 +0800 Subject: [PATCH] add partition table testcase --- executor/historical_stats_test.go | 2 ++ statistics/handle/dump.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/executor/historical_stats_test.go b/executor/historical_stats_test.go index 842b989c2c483..8c92ca32d55ec 100644 --- a/executor/historical_stats_test.go +++ b/executor/historical_stats_test.go @@ -292,9 +292,11 @@ PARTITION p0 VALUES LESS THAN (6) tblID = hsWorker.GetOneHistoricalStatsTable() require.NotEqual(t, tblID, -1) err = hsWorker.DumpHistoricalStats(tblID, h) + require.NoError(t, err) tblID = hsWorker.GetOneHistoricalStatsTable() require.NotEqual(t, tblID, -1) err = hsWorker.DumpHistoricalStats(tblID, h) + require.NoError(t, err) time.Sleep(1 * time.Second) snapshot = oracle.GoTimeToTS(time.Now()) jsTable, err = h.DumpHistoricalStatsBySnapshot("test", tbl.Meta(), snapshot) diff --git a/statistics/handle/dump.go b/statistics/handle/dump.go index 9ec73a8dedccb..81e982881ee83 100644 --- a/statistics/handle/dump.go +++ b/statistics/handle/dump.go @@ -175,7 +175,9 @@ func (h *Handle) DumpHistoricalStatsBySnapshot(dbName string, tableInfo *model.T if isDynamicMode { tbl, err := h.tableHistoricalStatsToJSON(tableInfo.ID, snapshot) if err != nil { - logutil.BgLogger().Warn("dump global historical stats failed", zap.Int64("table-id", tableInfo.ID)) + logutil.BgLogger().Warn("dump global historical stats failed", + zap.Int64("table-id", tableInfo.ID), + zap.String("table-name", tableInfo.Name.String())) } else if tbl != nil { jsonTbl.Partitions["global"] = tbl }