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
)
  • Loading branch information
xiongjiwei authored Apr 12, 2021
1 parent 2b23996 commit fe1cae5
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 fe1cae5

Please sign in to comment.