Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>

address the comment

Signed-off-by: yisaer <disxiaofei@163.com>

address the comment

Signed-off-by: yisaer <disxiaofei@163.com>

address the comment

Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed Dec 14, 2021
1 parent 7c61808 commit f286923
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
12 changes: 0 additions & 12 deletions ddl/db_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1304,18 +1304,6 @@ func (s *testIntegrationSuite3) TestCreateTableWithKeyPartition(c *C) {
tk.MustExec(`create table tm2 (a char(5), unique key(a(5))) partition by key() partitions 5;`)
}

func (s *testIntegrationSuite5) TestTry(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test;")
tk.MustExec("create table t (x int) partition by hash(x) partitions 4;")
ctx := tk.Se.(sessionctx.Context)
is := domain.GetDomain(ctx).InfoSchema()
tbl, err := is.TableByName(model.NewCIStr("test"), model.NewCIStr("t"))
c.Assert(err, IsNil)
p := tbl.Meta().Partition
fmt.Println(p)
}

func (s *testIntegrationSuite5) TestAlterTableAddPartition(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test;")
Expand Down
2 changes: 2 additions & 0 deletions planner/core/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ func MockRangePartitionTable() *model.TableInfo {
return tableInfo
}

// MockHashPartitionTable mocks a hash partition table for test
func MockHashPartitionTable() *model.TableInfo {
definitions := []model.PartitionDefinition{
{
Expand Down Expand Up @@ -505,6 +506,7 @@ func MockHashPartitionTable() *model.TableInfo {
return tableInfo
}

// MockListPartitionTable mocks a list partition table for test
func MockListPartitionTable() *model.TableInfo {
definitions := []model.PartitionDefinition{
{
Expand Down
4 changes: 2 additions & 2 deletions planner/core/rule_partition_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ func (s *partitionProcessor) makeUnionAllChildren(ds *DataSource, pi *model.Part

children := make([]LogicalPlan, 0, len(pi.Definitions))
partitionNameSet := make(set.StringSet)
usedDefinition := make(map[int64]model.PartitionDefinition, 0)
usedDefinition := make(map[int64]model.PartitionDefinition)
for _, r := range or {
for i := r.start; i < r.end; i++ {
// This is for `table partition (p0,p1)` syntax, only union the specified partition if has specified partitions.
Expand Down Expand Up @@ -1607,7 +1607,7 @@ func appendMakeUnionAllChildrenTranceStep(ds *DataSource, usedMap map[int64]mode
if i > 0 {
buffer.WriteString(",")
}
buffer.WriteString(fmt.Sprintf("%s", u.Name))
buffer.WriteString(u.Name.String())
}
buffer.WriteString("] after partition pruning")
return buffer.String()
Expand Down

0 comments on commit f286923

Please sign in to comment.