From 499e45f83eaa17f7cb337b27e6f17bf3698982e2 Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Mon, 9 Sep 2024 14:46:19 +0800 Subject: [PATCH] return state instead of schedule (#55942) --- pkg/executor/show_placement.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/executor/show_placement.go b/pkg/executor/show_placement.go index 45fee49b34616..b31bf6d564861 100644 --- a/pkg/executor/show_placement.go +++ b/pkg/executor/show_placement.go @@ -503,13 +503,9 @@ func fetchPartitionScheduleState(ctx context.Context, scheduleState map[int64]in } func fetchTablePartitionScheduleState(ctx context.Context, scheduleState map[int64]infosync.PlacementScheduleState, table *model.TableInfo, state infosync.PlacementScheduleState) (infosync.PlacementScheduleState, error) { - var ( - schedule infosync.PlacementScheduleState - err error - ) if table.GetPartitionInfo() != nil { for _, part := range table.GetPartitionInfo().Definitions { - schedule, err = fetchScheduleState(ctx, scheduleState, part.ID) + schedule, err := fetchScheduleState(ctx, scheduleState, part.ID) if err != nil { return infosync.PlacementScheduleStatePending, err } @@ -520,7 +516,7 @@ func fetchTablePartitionScheduleState(ctx context.Context, scheduleState map[int } } - return schedule, nil + return state, nil } func fetchTableScheduleState(ctx context.Context, scheduleState map[int64]infosync.PlacementScheduleState, table *model.TableInfo) (infosync.PlacementScheduleState, error) {