Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed May 6, 2024
1 parent 0f5507f commit 2ac315a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/planner/core/common_unity.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func dbName(fullName string) string {

func tblName(fullName string) string {
tmp := strings.Split(strings.ToLower(fullName), ".")
if len(tmp) < 2 {
return ""
}

return tmp[0] + "." + tmp[1]
}

Expand Down Expand Up @@ -65,7 +69,11 @@ type UnityOutput struct {

func collectColumn(c *expression.Column, o *UnityOutput) {
colName := strings.ToLower(c.OrigName)
o.Tables[tblName(colName)].Columns[colName] = &UnityColumnInfo{}
tName := tblName(colName)
if tName == "" {
return
}
o.Tables[tName].Columns[colName] = &UnityColumnInfo{}
}

func collectColumnFromExpr(expr expression.Expression, o *UnityOutput) {
Expand Down

0 comments on commit 2ac315a

Please sign in to comment.