Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ func (*ParenSelect) iInsertRows() {}
// If you add fields here, consider adding them to calls to validateSubquerySamePlan.
type Update struct {
Comments Comments
Ignore string
TableExprs TableExprs
Exprs UpdateExprs
Where *Where
Expand All @@ -596,8 +597,8 @@ type Update struct {

// Format formats the node.
func (node *Update) Format(buf *TrackedBuffer) {
buf.Myprintf("update %v%v set %v%v%v%v",
node.Comments, node.TableExprs,
buf.Myprintf("update %v%s%v set %v%v%v%v",
node.Comments, node.Ignore, node.TableExprs,
node.Exprs, node.Where, node.OrderBy, node.Limit)
}

Expand Down
2 changes: 2 additions & 0 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,8 @@ var (
}, {
input: "update foo f join bar b on f.name = b.name set f.id = b.id where b.name = 'test'",
output: "update foo as f join bar as b on f.name = b.name set f.id = b.id where b.name = 'test'",
}, {
input: "update /* ignore */ ignore a set b = 3",
}, {
input: "delete /* simple */ from a",
}, {
Expand Down
Loading