From 006e2fcd08752ba420b4d2c66077c80bcaaa4e8f Mon Sep 17 00:00:00 2001 From: Arenatlx <314806019@qq.com> Date: Fri, 5 Feb 2021 16:05:40 +0800 Subject: [PATCH] cmd: restore the old Execute API only for the test (#22692) Signed-off-by: AilinKid <314806019@qq.com> --- cmd/ddltest/column_test.go | 10 +++++----- cmd/ddltest/ddl_test.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/ddltest/column_test.go b/cmd/ddltest/column_test.go index c29d271ea0..adfd7dfe3c 100644 --- a/cmd/ddltest/column_test.go +++ b/cmd/ddltest/column_test.go @@ -211,15 +211,15 @@ func (s *TestDDLSuite) TestCommitWhenSchemaChanged(c *C) { s1, err := session.CreateSession(s.store) c.Assert(err, IsNil) ctx := goctx.Background() - _, err = s1.ExecuteInternal(ctx, "use test_ddl") + _, err = s1.Execute(ctx, "use test_ddl") c.Assert(err, IsNil) - s1.ExecuteInternal(ctx, "begin") - s1.ExecuteInternal(ctx, "insert into test_commit values (3, 3)") + s1.Execute(ctx, "begin") + s1.Execute(ctx, "insert into test_commit values (3, 3)") s.mustExec(c, "alter table test_commit drop column b") // When this transaction commit, it will find schema already changed. - s1.ExecuteInternal(ctx, "insert into test_commit values (4, 4)") - _, err = s1.ExecuteInternal(ctx, "commit") + s1.Execute(ctx, "insert into test_commit values (4, 4)") + _, err = s1.Execute(ctx, "commit") c.Assert(terror.ErrorEqual(err, plannercore.ErrWrongValueCountOnRow), IsTrue, Commentf("err %v", err)) } diff --git a/cmd/ddltest/ddl_test.go b/cmd/ddltest/ddl_test.go index 29d6be0ce1..3d3a6bb1e0 100644 --- a/cmd/ddltest/ddl_test.go +++ b/cmd/ddltest/ddl_test.go @@ -115,7 +115,7 @@ func (s *TestDDLSuite) SetUpSuite(c *C) { s.ctx = s.s.(sessionctx.Context) goCtx := goctx.Background() - _, err = s.s.ExecuteInternal(goCtx, "create database if not exists test_ddl") + _, err = s.s.Execute(goCtx, "create database if not exists test_ddl") c.Assert(err, IsNil) s.Bootstrap(c) @@ -130,7 +130,7 @@ func (s *TestDDLSuite) SetUpSuite(c *C) { s.dom, err = session.BootstrapSession(s.store) c.Assert(err, IsNil) s.ctx = s.s.(sessionctx.Context) - _, err = s.s.ExecuteInternal(goCtx, "use test_ddl") + _, err = s.s.Execute(goCtx, "use test_ddl") c.Assert(err, IsNil) addEnvPath("..") @@ -449,7 +449,7 @@ func (s *TestDDLSuite) getServer() *server { func (s *TestDDLSuite) runDDL(sql string) chan error { done := make(chan error, 1) go func() { - _, err := s.s.ExecuteInternal(goctx.Background(), sql) + _, err := s.s.Execute(goctx.Background(), sql) // We must wait 2 * lease time to guarantee all servers update the schema. if err == nil { time.Sleep(time.Duration(*lease) * time.Second * 2)