From a88390adba12e346f905b86511add459e761b180 Mon Sep 17 00:00:00 2001 From: Hangjie Mo Date: Fri, 21 Oct 2022 20:49:07 +0800 Subject: [PATCH] apply comments --- executor/infoschema_reader.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/executor/infoschema_reader.go b/executor/infoschema_reader.go index 383dfc8d74639..f8bd44ea923c2 100644 --- a/executor/infoschema_reader.go +++ b/executor/infoschema_reader.go @@ -1713,7 +1713,10 @@ func (e *memtableRetriever) setDataForTiKVRegionStatus(ctx sessionctx.Context) ( for _, tableID := range extractorTableIDs { regionsInfo, err := e.getRegionsInfoForTable(tikvHelper, is, tableID) if err != nil { - continue + if errors.ErrorEqual(err, infoschema.ErrTableExists) { + continue + } + return err } allRegionsInfo = allRegionsInfo.Merge(regionsInfo) } @@ -1736,11 +1739,8 @@ func (e *memtableRetriever) setDataForTiKVRegionStatus(ctx sessionctx.Context) ( if len(extractorTableIDs) == 0 { e.setNewTiKVRegionStatusCol(&allRegionsInfo.Regions[i], ®ionTableList[j]) } - for _, tableID := range extractorTableIDs { - if tableID == regionTableList[j].Table.ID { - e.setNewTiKVRegionStatusCol(&allRegionsInfo.Regions[i], ®ionTableList[j]) - break - } + if slices.Contains(extractorTableIDs, regionTableList[j].Table.ID) { + e.setNewTiKVRegionStatusCol(&allRegionsInfo.Regions[i], ®ionTableList[j]) } } }