Skip to content

Commit 97df94a

Browse files
committed
statistics: skip non-exicted table when to init stats
Signed-off-by: Weizhen Wang <[email protected]>
1 parent 5ac0b2e commit 97df94a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/statistics/handle/bootstrap.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,11 @@ func (h *Handle) initStatsHistograms4Chunk(is infoschema.InfoSchema, cache stats
185185
}
186186
id, ndv, nullCount, version, totColSize := row.GetInt64(2), row.GetInt64(3), row.GetInt64(5), row.GetUint64(4), row.GetInt64(7)
187187
lastAnalyzePos := row.GetDatum(11, types.NewFieldType(mysql.TypeBlob))
188-
tbl, _ := h.TableInfoByID(is, table.PhysicalID)
188+
tbl, ok := h.TableInfoByID(is, table.PhysicalID)
189+
if !ok {
190+
logutil.BgLogger().Warn("cannot find this table when to init stats", zap.Int64("tableID", table.PhysicalID))
191+
continue
192+
}
189193
if row.GetInt64(1) > 0 {
190194
var idxInfo *model.IndexInfo
191195
for _, idx := range tbl.Meta().Indices {

0 commit comments

Comments
 (0)