Skip to content

rename PLAN RECREATOR to PLAN REPLAYER #1294

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
24 changes: 12 additions & 12 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
_ StmtNode = &RestartStmt{}
_ StmtNode = &RenameUserStmt{}
_ StmtNode = &HelpStmt{}
_ StmtNode = &PlanRecreatorStmt{}
_ StmtNode = &PlanReplayerStmt{}

_ Node = &PrivElem{}
_ Node = &VariableAssignment{}
Expand Down Expand Up @@ -243,8 +243,8 @@ func (n *ExplainStmt) Accept(v Visitor) (Node, bool) {
return v.Leave(n)
}

// PlanRecreatorStmt is a statement to dump or load information for recreating plans
type PlanRecreatorStmt struct {
// PlanReplayerStmt is a statement to dump or load information for replaying plans
type PlanReplayerStmt struct {
stmtNode

Stmt StmtNode
Expand All @@ -260,13 +260,13 @@ type PlanRecreatorStmt struct {
}

// Restore implements Node interface.
func (n *PlanRecreatorStmt) Restore(ctx *format.RestoreCtx) error {
func (n *PlanReplayerStmt) Restore(ctx *format.RestoreCtx) error {
if n.Load {
ctx.WriteKeyWord("PLAN RECREATOR LOAD ")
ctx.WriteKeyWord("PLAN REPLAYER LOAD ")
ctx.WriteString(n.File)
return nil
}
ctx.WriteKeyWord("PLAN RECREATOR DUMP EXPLAIN ")
ctx.WriteKeyWord("PLAN REPLAYER DUMP EXPLAIN ")
if n.Analyze {
ctx.WriteKeyWord("ANALYZE ")
}
Expand All @@ -275,37 +275,37 @@ func (n *PlanRecreatorStmt) Restore(ctx *format.RestoreCtx) error {
if n.Where != nil {
ctx.WriteKeyWord(" WHERE ")
if err := n.Where.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore PlanRecreatorStmt.Where")
return errors.Annotate(err, "An error occurred while restore PlanReplayerStmt.Where")
}
}
if n.OrderBy != nil {
ctx.WriteKeyWord(" ")
if err := n.OrderBy.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore PlanRecreatorStmt.OrderBy")
return errors.Annotate(err, "An error occurred while restore PlanReplayerStmt.OrderBy")
}
}
if n.Limit != nil {
ctx.WriteKeyWord(" ")
if err := n.Limit.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore PlanRecreatorStmt.Limit")
return errors.Annotate(err, "An error occurred while restore PlanReplayerStmt.Limit")
}
}
return nil
}
if err := n.Stmt.Restore(ctx); err != nil {
return errors.Annotate(err, "An error occurred while restore PlanRecreatorStmt.Stmt")
return errors.Annotate(err, "An error occurred while restore PlanReplayerStmt.Stmt")
}
return nil
}

// Accept implements Node Accept interface.
func (n *PlanRecreatorStmt) Accept(v Visitor) (Node, bool) {
func (n *PlanReplayerStmt) Accept(v Visitor) (Node, bool) {
newNode, skipChildren := v.Enter(n)
if skipChildren {
return v.Leave(newNode)
}

n = newNode.(*PlanRecreatorStmt)
n = newNode.(*PlanReplayerStmt)

if n.Load {
return v.Leave(n)
Expand Down
2 changes: 1 addition & 1 deletion misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ var tokenMap = map[string]int{
"REBUILD": rebuild,
"RECENT": recent,
"RECOVER": recover,
"RECREATOR": recreator,
"REPLAYER": replayer,
"RECURSIVE": recursive,
"REDUNDANT": redundant,
"REFERENCES": references,
Expand Down
Loading