Skip to content

Commit

Permalink
planner: fix a bug that point get plan returns wrong column name (#23365
Browse files Browse the repository at this point in the history
) (#23970)
  • Loading branch information
ti-srebot authored Apr 30, 2021
1 parent 11a9254 commit 3073835
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion planner/core/point_get_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -919,14 +919,15 @@ func buildSchemaFromFields(
if col == nil {
return nil, nil
}
asName := col.Name
asName := colNameExpr.Name.Name
if field.AsName.L != "" {
asName = field.AsName
}
names = append(names, &types.FieldName{
DBName: dbName,
OrigTblName: tbl.Name,
TblName: tblName,
OrigColName: col.Name,
ColName: asName,
})
columns = append(columns, colInfoToColumn(col, len(columns)))
Expand Down

0 comments on commit 3073835

Please sign in to comment.