@@ -1996,7 +1996,7 @@ func (e *memtableRetriever) setDataForTiKVRegionStatus(ctx context.Context, sctx
1996
1996
for _ , tableID := range extractorTableIDs {
1997
1997
regionsInfo , err := e .getRegionsInfoForTable (ctx , tikvHelper , is , tableID )
1998
1998
if err != nil {
1999
- if errors .ErrorEqual (err , infoschema .ErrTableExists ) {
1999
+ if errors .ErrorEqual (err , infoschema .ErrTableNotExists ) {
2000
2000
continue
2001
2001
}
2002
2002
return err
@@ -2016,6 +2016,10 @@ func (e *memtableRetriever) setDataForTiKVRegionStatus(ctx context.Context, sctx
2016
2016
return err
2017
2017
}
2018
2018
}
2019
+ if allRegionsInfo == nil {
2020
+ return nil
2021
+ }
2022
+
2019
2023
tableInfos := tikvHelper .GetRegionsTableInfo (allRegionsInfo , is , nil )
2020
2024
for i := range allRegionsInfo .Regions {
2021
2025
regionTableList := tableInfos [allRegionsInfo .Regions [i ].ID ]
@@ -2040,7 +2044,7 @@ func (e *memtableRetriever) setDataForTiKVRegionStatus(ctx context.Context, sctx
2040
2044
func (e * memtableRetriever ) getRegionsInfoForTable (ctx context.Context , h * helper.Helper , is infoschema.InfoSchema , tableID int64 ) (* pd.RegionsInfo , error ) {
2041
2045
tbl , _ := is .TableByID (ctx , tableID )
2042
2046
if tbl == nil {
2043
- return nil , infoschema .ErrTableExists .GenWithStackByArgs (tableID )
2047
+ return nil , infoschema .ErrTableNotExists .GenWithStackByArgs (tableID )
2044
2048
}
2045
2049
2046
2050
pt := tbl .Meta ().GetPartitionInfo ()
0 commit comments