From 11ee81ab800127c34b8a4d671973d34757ca89cf Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Fri, 1 Nov 2019 14:49:38 -0400 Subject: [PATCH] sql: fix assignment of dropped table job status We were mistakenly mutating a copy of a slice element in a loop while updating the status for a job for a table drop, causing an incorrect job status to be reported. Release note (bug fix): A bug was fixed that caused jobs for dropping tables to report an inaccurate status. --- pkg/sql/table.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sql/table.go b/pkg/sql/table.go index 2cb7261e2f78..20186f7233c7 100644 --- a/pkg/sql/table.go +++ b/pkg/sql/table.go @@ -798,8 +798,8 @@ func (p *planner) createDropTablesJob( if !drainNames { detailStatus = jobspb.Status_WAIT_FOR_GC_INTERVAL } - for _, droppedDetail := range droppedDetails { - droppedDetail.Status = detailStatus + for i := range droppedDetails { + droppedDetails[i].Status = detailStatus } runningStatus := RunningStatusDrainingNames