Skip to content

Commit

Permalink
revert pr 587 failed to parse WHERE / GROUP BY clauses in a SELECT st…
Browse files Browse the repository at this point in the history
…atement without a FROM table (#597)
  • Loading branch information
tiancaiamao authored Oct 31, 2019
1 parent 8839bb5 commit bfb0c3a
Show file tree
Hide file tree
Showing 4 changed files with 3,346 additions and 3,303 deletions.
3 changes: 3 additions & 0 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,9 @@ func (n *SelectStmt) Restore(ctx *RestoreCtx) error {
}
}

if n.From == nil && n.Where != nil {
ctx.WriteKeyWord(" FROM DUAL")
}
if n.Where != nil {
ctx.WriteKeyWord(" WHERE ")
if err := n.Where.Restore(ctx); err != nil {
Expand Down
Loading

0 comments on commit bfb0c3a

Please sign in to comment.