Skip to content

Commit

Permalink
statistics: fix panic in the RecordHistoricalStatsToStorage (#49077)
Browse files Browse the repository at this point in the history
close #49076
  • Loading branch information
hawkingrei authored Dec 1, 2023
1 parent ff9252c commit df41e20
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/statistics/handle/history/history_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ func (sh *statsHistoryImpl) RecordHistoricalStatsToStorage(dbName string, tableI
if err != nil {
return 0, errors.Trace(err)
}

if js == nil {
logutil.BgLogger().Warn("no stats data to record", zap.String("dbName", dbName), zap.String("tableName", tableInfo.Name.O))
return 0, nil
}
var version uint64
err = util.CallWithSCtx(sh.statsHandle.SPool(), func(sctx sessionctx.Context) error {
version, err = RecordHistoricalStatsToStorage(sctx, physicalID, js)
Expand Down

0 comments on commit df41e20

Please sign in to comment.