statistics: handle topn reference if it is nil (#35328)
statistics: handle topn reference if it is nil (#35328)

ref pingcap/tidb#34052
pingcap/tidb,kyle-wang/tidb,pingcap/tidb,kyle-wang/tidb,kyle-wang/tidb,pingcap/tidb,ngaut/tidb,kyle-wang/tidb,kyle-wang/tidb,ngaut/tidb,ngaut/tidb,kyle-wang/tidb,ngaut/tidb,ngaut/tidb,pingcap/tidb,pingcap/tidb,pingcap/tidb,ngaut/tidb