(n *pcast.SelectStmt)
| 561 | } |
| 562 | |
| 563 | func (c *cc) convertSelectStmt(n *pcast.SelectStmt) *ast.SelectStmt { |
| 564 | windowClause := &ast.List{Items: make([]ast.Node, 0)} |
| 565 | orderByClause := c.convertOrderByClause(n.OrderBy) |
| 566 | if orderByClause != nil { |
| 567 | windowClause.Items = append(windowClause.Items, orderByClause) |
| 568 | } |
| 569 | |
| 570 | op, all := c.convertSetOprType(n.AfterSetOperator) |
| 571 | stmt := &ast.SelectStmt{ |
| 572 | TargetList: c.convertFieldList(n.Fields), |
| 573 | FromClause: c.convertTableRefsClause(n.From), |
| 574 | GroupClause: c.convertGroupByClause(n.GroupBy), |
| 575 | HavingClause: c.convertHavingClause(n.Having), |
| 576 | WhereClause: c.convert(n.Where), |
| 577 | WithClause: c.convertWithClause(n.With), |
| 578 | WindowClause: windowClause, |
| 579 | Op: op, |
| 580 | All: all, |
| 581 | } |
| 582 | if n.Limit != nil { |
| 583 | stmt.LimitCount = c.convert(n.Limit.Count) |
| 584 | stmt.LimitOffset = c.convert(n.Limit.Offset) |
| 585 | } |
| 586 | return stmt |
| 587 | } |
| 588 | |
| 589 | func (c *cc) convertSubqueryExpr(n *pcast.SubqueryExpr) ast.Node { |
| 590 | // Wrap subquery in SubLink to ensure parentheses are added |
no test coverage detected