|
|
@ -485,11 +485,13 @@ func (q *Query) FromSelect(selectStmt *sqlparser.Select) error { |
|
|
|
|
|
|
|
switch right := form.RightExpr.(type) { |
|
|
|
case *sqlparser.AliasedTableExpr: |
|
|
|
join.Query = &Query{} |
|
|
|
if right.As.String() != "" { |
|
|
|
join.Query = &Query{From: From{As: right.As.String()}} |
|
|
|
join.Query.From.As = right.As.String() |
|
|
|
} |
|
|
|
switch rightExpr := right.Expr.(type) { |
|
|
|
case sqlparser.TableName: |
|
|
|
log.Println("rightExpr:", jsonEncode(rightExpr)) |
|
|
|
join.Query.From.Table = string(rightExpr.Name.String()) |
|
|
|
case *sqlparser.Subquery: |
|
|
|
subQuery := &Query{} |
|
|
|