diff --git a/ddl/schematracker/dm_tracker_test.go b/ddl/schematracker/dm_tracker_test.go index 01998d3dc0134..4debade8dd884 100644 --- a/ddl/schematracker/dm_tracker_test.go +++ b/ddl/schematracker/dm_tracker_test.go @@ -506,3 +506,25 @@ func TestModifyFromNullToNotNull(t *testing.T) { tblInfo := mustTableByName(t, tracker, "test", "t") require.Len(t, tblInfo.Columns, 2) } + +func TestDropListPartition(t *testing.T) { + sql := ` +CREATE TABLE test.employees11 ( +id INT NOT NULL, +hired DATE NOT NULL DEFAULT '1970-01-01', +store_id INT, +PRIMARY KEY (id,store_id) +) +PARTITION BY LIST (store_id) ( +PARTITION pNorth VALUES IN (1, 2, 3, 4, 5), +PARTITION pEast VALUES IN (6, 7, 8, 9, 10), +PARTITION pWest VALUES IN (11, 12, 13, 14, 15), +PARTITION pCentral VALUES IN (16, 17, 18, 19, 20) +);` + tracker := schematracker.NewSchemaTracker(2) + tracker.CreateTestDB() + execCreate(t, tracker, sql) + + sql = "ALTER TABLE test.employees11 DROP PARTITION pEast;" + execAlter(t, tracker, sql) +} diff --git a/util/mock/context.go b/util/mock/context.go index 753d203754f18..3445e73d4b603 100644 --- a/util/mock/context.go +++ b/util/mock/context.go @@ -485,6 +485,7 @@ func NewContext() *Context { vars.MinPagingSize = variable.DefMinPagingSize vars.CostModelVersion = variable.DefTiDBCostModelVer vars.EnableChunkRPC = true + vars.EnableListTablePartition = true if err := sctx.GetSessionVars().SetSystemVar(variable.MaxAllowedPacket, "67108864"); err != nil { panic(err) }