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
) (#23969)
  • Loading branch information
ti-srebot authored Apr 16, 2021
1 parent a5ff9a5 commit 760c176
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 @@ -1019,14 +1019,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 760c176

Please sign in to comment.