Skip to content

Commit ae18f5c

Browse files
committed
fix
1 parent 5d83bb8 commit ae18f5c

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

executor/builder.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ func (b *executorBuilder) buildCancelDDLJobs(v *plannercore.CancelDDLJobs) Execu
211211

212212
func (b *executorBuilder) buildChange(v *plannercore.Change) Executor {
213213
return &ChangeExec{
214-
Statement: v.Statement,
214+
NodeType: v.NodeType,
215+
State: v.State,
216+
NodeID: v.NodeID,
215217
}
216218
}
217219

executor/change.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import (
1818
"strings"
1919

2020
"github.com/pingcap/errors"
21-
"github.com/pingcap/parser/ast"
2221
"github.com/pingcap/tidb-tools/tidb-binlog/node"
2322
"github.com/pingcap/tidb/config"
2423
"github.com/pingcap/tidb/util/chunk"
@@ -28,13 +27,14 @@ import (
2827
type ChangeExec struct {
2928
baseExecutor
3029

31-
Statement *ast.ChangeStmt
30+
NodeType string
31+
State string
32+
NodeID string
3233
}
3334

3435
// Next implements the Executor Next interface.
3536
func (e *ChangeExec) Next(ctx context.Context, req *chunk.RecordBatch) error {
36-
stmt := e.Statement
37-
kind := strings.ToLower(stmt.NodeType)
37+
kind := strings.ToLower(e.NodeType)
3838
urls := config.GetGlobalConfig().Path
3939
registry, err := createRegistry(urls)
4040
if err != nil {
@@ -44,8 +44,8 @@ func (e *ChangeExec) Next(ctx context.Context, req *chunk.RecordBatch) error {
4444
if err != nil {
4545
return err
4646
}
47-
state := stmt.State
48-
nodeID := stmt.NodeID
47+
state := e.State
48+
nodeID := e.NodeID
4949
for _, n := range nodes {
5050
if n.NodeID != nodeID {
5151
continue

planner/core/common_plans.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ type CancelDDLJobs struct {
137137
type Change struct {
138138
baseSchemaProducer
139139

140-
Statement *ast.ChangeStmt
140+
NodeType string
141+
State string
142+
NodeID string
141143
}
142144

143145
// Prepare represents prepare plan.

planner/core/planbuilder.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,11 @@ func (b *PlanBuilder) Build(node ast.Node) (Plan, error) {
224224
}
225225

226226
func (b *PlanBuilder) buildChange(v *ast.ChangeStmt) (Plan, error) {
227-
exe := &Change{Statement: v}
227+
exe := &Change{
228+
NodeType: v.NodeType,
229+
State: v.State,
230+
NodeID: v.NodeID,
231+
}
228232
return exe, nil
229233
}
230234

0 commit comments

Comments
 (0)