Skip to content

Commit

Permalink
ddl: include the test case for truncating partitioned tables
Browse files Browse the repository at this point in the history
  • Loading branch information
kennytm committed Jul 22, 2019
1 parent ebcbe18 commit 018924b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ddl/db_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1495,3 +1495,12 @@ func (s *testIntegrationSuite3) TestUnsupportedPartitionManagementDDLs(c *C) {
_, err = tk.Exec("alter table test_1465 partition by hash(a)")
c.Assert(err, ErrorMatches, ".*alter table partition is unsupported")
}

func (s *testIntegrationSuite8) TestTruncateTableWithPartition(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test;")
tk.MustExec("drop table if exists test_4414;")
tk.MustExec("create table test_4414(a int, b int) partition by hash(a) partitions 10;")
tk.MustExec("truncate table test_4414;")
tk.MustQuery("select * from test_4414 partition (p0)").Check(testkit.Rows())
}

0 comments on commit 018924b

Please sign in to comment.