From 30738358090700448b19d8c3f47e0d7feacede4d Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Fri, 30 Apr 2021 12:25:50 +0800 Subject: [PATCH] planner: fix a bug that point get plan returns wrong column name (#23365) (#23970) --- planner/core/point_get_plan.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/planner/core/point_get_plan.go b/planner/core/point_get_plan.go index d499a6cf81922..a2a4477dd2e74 100644 --- a/planner/core/point_get_plan.go +++ b/planner/core/point_get_plan.go @@ -919,7 +919,7 @@ func buildSchemaFromFields( if col == nil { return nil, nil } - asName := col.Name + asName := colNameExpr.Name.Name if field.AsName.L != "" { asName = field.AsName } @@ -927,6 +927,7 @@ func buildSchemaFromFields( DBName: dbName, OrigTblName: tbl.Name, TblName: tblName, + OrigColName: col.Name, ColName: asName, }) columns = append(columns, colInfoToColumn(col, len(columns)))