-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support update pump or drainer status #243
Support update pump or drainer status #243
Conversation
Support update pump or drainer status
…ate_Pump_or_Drainer_status_2019_3_14
LGTM |
@kennytm PTAL |
ast/misc.go
Outdated
|
||
// Restore implements Node interface. | ||
func (n *ChangeStmt) Restore(ctx *RestoreCtx) error { | ||
ctx.WriteKeyWord(fmt.Sprintf("CHANGE %s TO", strings.ToUpper(n.NodeType))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord(fmt.Sprintf("CHANGE %s TO", strings.ToUpper(n.NodeType))) | |
ctx.WriteKeyWord("CHANGE ") | |
ctx.WriteKeyWord(n.NodeType) | |
ctx.WriteKeyWord(" TO ") |
ast/misc.go
Outdated
type ChangeStmt struct { | ||
stmtNode | ||
|
||
NodeType string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use an enum
for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i already changed, but i need you confirm it.
ast/misc.go
Outdated
|
||
// Restore implements Node interface. | ||
func (n *ChangeStmt) Restore(ctx *RestoreCtx) error { | ||
ctx.WriteKeyWord("CHANGE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord("CHANGE") | |
ctx.WriteKeyWord("CHANGE ") |
ast/misc.go
Outdated
// Restore implements Node interface. | ||
func (n *ChangeStmt) Restore(ctx *RestoreCtx) error { | ||
ctx.WriteKeyWord("CHANGE") | ||
ctx.WriteKeyWord(strings.ToUpper(n.NodeType)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord(strings.ToUpper(n.NodeType)) | |
ctx.WriteKeyWord(n.NodeType) |
ast/misc.go
Outdated
func (n *ChangeStmt) Restore(ctx *RestoreCtx) error { | ||
ctx.WriteKeyWord("CHANGE") | ||
ctx.WriteKeyWord(strings.ToUpper(n.NodeType)) | ||
ctx.WriteKeyWord("TO") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord("TO") | |
ctx.WriteKeyWord(" TO NODE_STATE ") |
And delete the next line
ast/misc.go
Outdated
ctx.WriteKeyWord("NODE_STATE") | ||
ctx.WritePlain("=") | ||
ctx.WriteString(n.State) | ||
ctx.WriteKeyWord("FOR") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord("FOR") | |
ctx.WriteKeyWord(" FOR NODE_ID ") |
And delete the next line
# Conflicts: # parser.y
…_3_14 # Conflicts: # parser.go
…_3_14 # Conflicts: # parser.go
# Conflicts: # parser.y
…ate_Pump_or_Drainer_status_2019_3_14 # Conflicts: # parser.y
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
support_update_Pump_or_Drainer_status
proposal:pingcap/tidb#9201
What is changed and how it works?
it will change parser.y/parser.go/ast.misc.go /misc.go.
Check List
Tests
Code changes
Side effects
Related changes