Skip to content
7 changes: 7 additions & 0 deletions ast/dml.go
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ func (s *SetOprType) String() string {
type SetOprStmt struct {
dmlNode

IsInBraces bool
SelectList *SetOprSelectList
OrderBy *OrderByClause
Limit *Limit
Expand All @@ -1563,6 +1564,12 @@ func (n *SetOprStmt) Restore(ctx *format.RestoreCtx) error {
return errors.Annotate(err, "An error occurred while restore UnionStmt.With")
}
}
if n.IsInBraces {
ctx.WritePlain("(")
defer func() {
ctx.WritePlain(")")
}()
}

if err := n.SelectList.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore SetOprStmt.SelectList")
Expand Down
Loading