From 88802e60b83394c78d325b67a0c9412315f29d3f Mon Sep 17 00:00:00 2001 From: lihaowei Date: Wed, 2 Jun 2021 16:17:22 +0800 Subject: [PATCH] remove unrelated Signed-off-by: lihaowei --- ddl/serial_test.go | 7 ------- planner/core/planbuilder.go | 3 --- 2 files changed, 10 deletions(-) diff --git a/ddl/serial_test.go b/ddl/serial_test.go index 8d9217e1df8e3..f78ff3d16577b 100644 --- a/ddl/serial_test.go +++ b/ddl/serial_test.go @@ -534,13 +534,6 @@ func (s *testSerialSuite) TestCreateTableWithLike(c *C) { _, err = tk.Exec("create table temporary_table_t1 like temporary_table") c.Assert(err.Error(), Equals, core.ErrOptOnTemporaryTable.GenWithStackByArgs("create table like").Error()) tk.MustExec("drop table if exists temporary_table;") - - tk.MustExec("drop table if exists temporary_table_like;") - tk.MustExec("create table temporary_table (a int, b int,index(a))") - tk.MustExec("drop table if exists temporary_table_like_t1;") - _, err = tk.Exec("create global temporary table temporary_table_like_t1 like temporary_table on commit delete rows;") - c.Assert(err.Error(), Equals, core.ErrOptOnTemporaryTable.GenWithStackByArgs("create table like").Error()) - tk.MustExec("drop table if exists temporary_table_like;") } // TestCancelAddIndex1 tests canceling ddl job when the add index worker is not started. diff --git a/planner/core/planbuilder.go b/planner/core/planbuilder.go index 9cb607d3e1f1a..0a43cb85ea0f9 100644 --- a/planner/core/planbuilder.go +++ b/planner/core/planbuilder.go @@ -3480,9 +3480,6 @@ func (b *PlanBuilder) buildDDL(ctx context.Context, node ast.DDLNode) (Plan, err return nil, infoschema.ErrCannotAddForeign } } - if v.ReferTable != nil { - return nil, ErrOptOnTemporaryTable.GenWithStackByArgs("create table like") - } } if b.ctx.GetSessionVars().User != nil { authErr = ErrTableaccessDenied.GenWithStackByArgs("CREATE", b.ctx.GetSessionVars().User.AuthUsername,