(n *pcast.UpdateStmt)
| 645 | } |
| 646 | |
| 647 | func (c *cc) convertUpdateStmt(n *pcast.UpdateStmt) *ast.UpdateStmt { |
| 648 | rels := c.convertTableRefsClause(n.TableRefs) |
| 649 | if len(rels.Items) != 1 { |
| 650 | panic("expected one range var") |
| 651 | } |
| 652 | |
| 653 | relations := &ast.List{} |
| 654 | convertToRangeVarList(rels, relations) |
| 655 | |
| 656 | // TargetList |
| 657 | list := &ast.List{} |
| 658 | for _, a := range n.List { |
| 659 | list.Items = append(list.Items, c.convertAssignment(a)) |
| 660 | } |
| 661 | stmt := &ast.UpdateStmt{ |
| 662 | Relations: relations, |
| 663 | TargetList: list, |
| 664 | WhereClause: c.convert(n.Where), |
| 665 | FromClause: &ast.List{}, |
| 666 | ReturningList: &ast.List{}, |
| 667 | WithClause: c.convertWithClause(n.With), |
| 668 | } |
| 669 | if n.Limit != nil { |
| 670 | stmt.LimitCount = c.convert(n.Limit.Count) |
| 671 | } |
| 672 | return stmt |
| 673 | } |
| 674 | |
| 675 | func (c *cc) convertValueExpr(n *driver.ValueExpr) *ast.A_Const { |
| 676 | switch n.TexprNode.Type.GetType() { |
no test coverage detected