From 6a8e27eefd4d34c672df015da1b94a1d01206271 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Fri, 18 Sep 2020 17:05:57 +0800 Subject: [PATCH] ddl: enlarge the limit of the number of partitions in a table (#20089) --- ddl/db_partition_test.go | 6 +++--- ddl/ddl.go | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ddl/db_partition_test.go b/ddl/db_partition_test.go index 50d671eaab..701a0a3780 100644 --- a/ddl/db_partition_test.go +++ b/ddl/db_partition_test.go @@ -1280,7 +1280,7 @@ func (s *testIntegrationSuite4) TestAddPartitionTooManyPartitions(c *C) { for i := 1; i <= count; i++ { sql1 += fmt.Sprintf("partition p%d values less than (%d),", i, i) } - sql1 += "partition p1025 values less than (1025) );" + sql1 += "partition p8193 values less than (8193) );" tk.MustGetErrCode(sql1, tmysql.ErrTooManyPartitions) tk.MustExec("drop table if exists p2;") @@ -1291,11 +1291,11 @@ func (s *testIntegrationSuite4) TestAddPartitionTooManyPartitions(c *C) { for i := 1; i < count; i++ { sql2 += fmt.Sprintf("partition p%d values less than (%d),", i, i) } - sql2 += "partition p1024 values less than (1024) );" + sql2 += "partition p8192 values less than (8192) );" tk.MustExec(sql2) sql3 := `alter table p2 add partition ( - partition p1025 values less than (1025) + partition p8193 values less than (8193) );` tk.MustGetErrCode(sql3, tmysql.ErrTooManyPartitions) } diff --git a/ddl/ddl.go b/ddl/ddl.go index 5619f5022f..79d639eeb4 100644 --- a/ddl/ddl.go +++ b/ddl/ddl.go @@ -59,9 +59,8 @@ const ( batchAddingJobs = 10 // PartitionCountLimit is limit of the number of partitions in a table. - // Mysql maximum number of partitions is 8192, our maximum number of partitions is 1024. // Reference linking https://dev.mysql.com/doc/refman/5.7/en/partitioning-limitations.html. - PartitionCountLimit = 1024 + PartitionCountLimit = 8192 ) // OnExist specifies what to do when a new object has a name collision.