Skip to content

Commit

Permalink
Revert "fix sort in explain (pingcap#2933)" (pingcap#2936)
Browse files Browse the repository at this point in the history
This reverts commit a6bf923.
  • Loading branch information
shenli authored Mar 27, 2017
1 parent a6bf923 commit 95fb7d0
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 40 deletions.
4 changes: 2 additions & 2 deletions executor/explain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,10 @@ func (s *testSuite) TestExplain(c *C) {
{
"select * from t2 order by t2.c2 limit 0, 1",
[]string{
"TableScan_5", "Sort_6",
"TableScan_5", "",
},
[]string{
"Sort_6", "",
"", "",
},
[]string{
`{
Expand Down
52 changes: 26 additions & 26 deletions executor/merge_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"github.com/pingcap/tidb/util/testleak"
)

const plan1 = `[[TableScan_12 {
const plan1 = `[[TableScan_11 {
"db": "test",
"table": "t1",
"desc": false,
Expand All @@ -34,7 +34,7 @@ const plan1 = `[[TableScan_12 {
"index filter conditions": null,
"table filter conditions": null
}
} MergeJoin_17] [TableScan_15 {
} MergeJoin_14] [TableScan_13 {
"db": "test",
"table": "t2",
"desc": false,
Expand All @@ -45,17 +45,17 @@ const plan1 = `[[TableScan_12 {
"index filter conditions": null,
"table filter conditions": null
}
} MergeJoin_17] [MergeJoin_17 {
} MergeJoin_14] [MergeJoin_14 {
"eqCond": [
"eq(test.t1.c1, test.t2.c1)"
],
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "TableScan_12",
"rightPlan": "TableScan_15",
"leftPlan": "TableScan_11",
"rightPlan": "TableScan_13",
"desc": "false"
} MergeJoin_8] [TableScan_22 {
} MergeJoin_8] [TableScan_16 {
"db": "test",
"table": "t3",
"desc": false,
Expand All @@ -73,10 +73,10 @@ const plan1 = `[[TableScan_12 {
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "MergeJoin_17",
"rightPlan": "TableScan_22",
"leftPlan": "MergeJoin_14",
"rightPlan": "TableScan_16",
"desc": "false"
} Sort_23] [Sort_23 {
} ] [ {
"exprs": [
{
"Expr": "test.t1.c1",
Expand All @@ -87,7 +87,7 @@ const plan1 = `[[TableScan_12 {
"child": "MergeJoin_8"
} ]]`

const plan2 = `[[TableScan_12 {
const plan2 = `[[TableScan_11 {
"db": "test",
"table": "t1",
"desc": false,
Expand All @@ -98,7 +98,7 @@ const plan2 = `[[TableScan_12 {
"index filter conditions": null,
"table filter conditions": null
}
} MergeJoin_17] [TableScan_15 {
} MergeJoin_14] [TableScan_13 {
"db": "test",
"table": "t2",
"desc": false,
Expand All @@ -109,17 +109,17 @@ const plan2 = `[[TableScan_12 {
"index filter conditions": null,
"table filter conditions": null
}
} MergeJoin_17] [MergeJoin_17 {
} MergeJoin_14] [MergeJoin_14 {
"eqCond": [
"eq(test.t1.c1, test.t2.c1)"
],
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "TableScan_12",
"rightPlan": "TableScan_15",
"leftPlan": "TableScan_11",
"rightPlan": "TableScan_13",
"desc": "false"
} MergeJoin_8] [TableScan_22 {
} MergeJoin_8] [TableScan_16 {
"db": "test",
"table": "t3",
"desc": false,
Expand All @@ -137,10 +137,10 @@ const plan2 = `[[TableScan_12 {
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "MergeJoin_17",
"rightPlan": "TableScan_22",
"leftPlan": "MergeJoin_14",
"rightPlan": "TableScan_16",
"desc": "false"
} Sort_23] [Sort_23 {
} ] [ {
"exprs": [
{
"Expr": "test.t1.c1",
Expand All @@ -151,7 +151,7 @@ const plan2 = `[[TableScan_12 {
"child": "MergeJoin_8"
} ]]`

const plan3 = `[[TableScan_12 {
const plan3 = `[[TableScan_11 {
"db": "test",
"table": "t1",
"desc": false,
Expand All @@ -162,7 +162,7 @@ const plan3 = `[[TableScan_12 {
"index filter conditions": null,
"table filter conditions": null
}
} MergeJoin_9] [TableScan_15 {
} MergeJoin_9] [TableScan_13 {
"db": "test",
"table": "t2",
"desc": false,
Expand All @@ -180,10 +180,10 @@ const plan3 = `[[TableScan_12 {
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "TableScan_12",
"rightPlan": "TableScan_15",
"leftPlan": "TableScan_11",
"rightPlan": "TableScan_13",
"desc": "false"
} Sort_16] [Sort_16 {
} ] [ {
"exprs": [
{
"Expr": "test.t1.c1",
Expand All @@ -192,7 +192,7 @@ const plan3 = `[[TableScan_12 {
],
"limit": null,
"child": "MergeJoin_9"
} MergeJoin_8] [TableScan_23 {
} MergeJoin_8] [TableScan_16 {
"db": "test",
"table": "t3",
"desc": false,
Expand All @@ -210,8 +210,8 @@ const plan3 = `[[TableScan_12 {
"leftCond": null,
"rightCond": null,
"otherCond": [],
"leftPlan": "Sort_16",
"rightPlan": "TableScan_23",
"leftPlan": "",
"rightPlan": "TableScan_16",
"desc": "false"
} ]]`

Expand Down
3 changes: 0 additions & 3 deletions plan/physical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,6 @@ func enforceProperty(prop *requiredProperty, info *physicalPlanInfo) *physicalPl
ByItems: items,
ExecLimit: prop.limit,
}
sort.tp = Srt
sort.allocator = info.p.Allocator()
sort.initIDAndContext(info.p.context())
sort.SetSchema(info.p.Schema())
info = addPlanToResponse(sort, info)

Expand Down
3 changes: 0 additions & 3 deletions plan/physical_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ func (p *physicalTableSource) tryToAddUnionScan(resultPlan PhysicalPlan) Physica
us := &PhysicalUnionScan{
Condition: expression.ComposeCNFCondition(p.ctx, append(conditions, p.AccessCondition...)...),
}
us.tp = "UnionScan"
us.allocator = p.allocator
us.initIDAndContext(p.ctx)
us.SetChildren(resultPlan)
us.SetSchema(resultPlan.Schema())
return us
Expand Down
6 changes: 0 additions & 6 deletions plan/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ type Plan interface {
Schema() *expression.Schema
// Get the ID.
ID() string
// Get id allocator
Allocator() *idAllocator
// SetParents sets the parents for the plan.
SetParents(...Plan)
// SetParents sets the children for the plan.
Expand Down Expand Up @@ -292,10 +290,6 @@ func (p *basePlan) extractCorrelatedCols() []*expression.CorrelatedColumn {
return corCols
}

func (p *basePlan) Allocator() *idAllocator {
return p.allocator
}

// ResolveIndicesAndCorCols implements LogicalPlan interface.
func (p *baseLogicalPlan) ResolveIndicesAndCorCols() {
for _, child := range p.children {
Expand Down

0 comments on commit 95fb7d0

Please sign in to comment.