From 625a91f6a3d078082d440c1f0fe4f9970794d616 Mon Sep 17 00:00:00 2001 From: wshwsh12 <793703860@qq.com> Date: Tue, 30 Aug 2022 10:26:59 +0800 Subject: [PATCH] address comments --- planner/core/fragment.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planner/core/fragment.go b/planner/core/fragment.go index 17f7a7ea4c2e7..ec5785404757f 100644 --- a/planner/core/fragment.go +++ b/planner/core/fragment.go @@ -305,9 +305,9 @@ func partitionPruning(ctx sessionctx.Context, tbl table.PartitionedTable, conds if len(partitionNames) == 0 { ret = []table.PhysicalTable{tbl.GetPartition(pi.Definitions[0].ID)} } else { - for i, def := range pi.Definitions { + for _, def := range pi.Definitions { if def.Name.L == partitionNames[0].L { - ret = []table.PhysicalTable{tbl.GetPartition(pi.Definitions[i].ID)} + ret = []table.PhysicalTable{tbl.GetPartition(def.ID)} break } }