Skip to content

Commit 018924b

Browse files
committed
ddl: include the test case for truncating partitioned tables
1 parent ebcbe18 commit 018924b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ddl/db_partition_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,3 +1495,12 @@ func (s *testIntegrationSuite3) TestUnsupportedPartitionManagementDDLs(c *C) {
14951495
_, err = tk.Exec("alter table test_1465 partition by hash(a)")
14961496
c.Assert(err, ErrorMatches, ".*alter table partition is unsupported")
14971497
}
1498+
1499+
func (s *testIntegrationSuite8) TestTruncateTableWithPartition(c *C) {
1500+
tk := testkit.NewTestKit(c, s.store)
1501+
tk.MustExec("use test;")
1502+
tk.MustExec("drop table if exists test_4414;")
1503+
tk.MustExec("create table test_4414(a int, b int) partition by hash(a) partitions 10;")
1504+
tk.MustExec("truncate table test_4414;")
1505+
tk.MustQuery("select * from test_4414 partition (p0)").Check(testkit.Rows())
1506+
}

0 commit comments

Comments
 (0)