Browse Source

'fix'

apijson
u 2 years ago
parent
commit
b4fd978cae
  1. 4
      types.go

4
types.go

@ -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{}

Loading…
Cancel
Save