Skip to content

Commit

Permalink
small change & update parser
Browse files Browse the repository at this point in the history
  • Loading branch information
foreyes committed Aug 13, 2019
1 parent 3a13e47 commit f69753e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ require (
sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67
)

replace github.com/pingcap/parser => github.com/foreyes/parser v0.0.0-20190808081829-554c38302868
replace github.com/pingcap/parser => github.com/foreyes/parser v0.0.0-20190813063912-8bb2126c1499
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 h1:clC1lXBpe2kTj2VHdaIu9ajZQe4kcEY9j0NsnDDBZ3o=
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/foreyes/parser v0.0.0-20190808081829-554c38302868 h1:0NCpYx5gkfsCBOq3W1125IpzJvJLEDngodN/oYLIP3E=
github.com/foreyes/parser v0.0.0-20190808081829-554c38302868/go.mod h1:3lbW3qHt81o5eguDSsve9wLN8OtUzvdZrVQ/pngnIg0=
github.com/foreyes/parser v0.0.0-20190813063912-8bb2126c1499 h1:s6EoP5pzlkTvs6oLenAb5lApcqe2nQr2EA3kL5soDX4=
github.com/foreyes/parser v0.0.0-20190813063912-8bb2126c1499/go.mod h1:3lbW3qHt81o5eguDSsve9wLN8OtUzvdZrVQ/pngnIg0=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 h1:Mn26/9ZMNWSw9C9ERFA1PUxfmGpolnw2v0bKOREu5ew=
Expand Down
4 changes: 2 additions & 2 deletions planner/core/exhaust_physical_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,9 @@ func (p *LogicalJoin) tryToGetIndexJoin(prop *property.PhysicalProperty) (indexJ
defer func() {
if !forced && hasIndexJoinHint {
// Construct warning message prefix.
errMsg := "Optimizer Hint TIDB_INLJ is inapplicable"
errMsg := "Optimizer Hint INL_JOIN is inapplicable"
if p.hintInfo != nil {
errMsg = fmt.Sprintf("Optimizer Hint %s is inapplicable", restore2JoinHint(TiDBIndexNestedLoopJoin, p.hintInfo.indexNestedLoopJoinTables))
errMsg = fmt.Sprintf("Optimizer Hint %s is inapplicable", restore2JoinHint(HintINLJ, p.hintInfo.indexNestedLoopJoinTables))
}

// Append inapplicable reason.
Expand Down
6 changes: 3 additions & 3 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1971,9 +1971,9 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint) {

func (b *PlanBuilder) popTableHints() {
hintInfo := b.tableHintInfo[len(b.tableHintInfo)-1]
b.appendUnmatchedJoinHintWarning(TiDBIndexNestedLoopJoin, hintInfo.indexNestedLoopJoinTables)
b.appendUnmatchedJoinHintWarning(TiDBMergeJoin, hintInfo.sortMergeJoinTables)
b.appendUnmatchedJoinHintWarning(TiDBHashJoin, hintInfo.hashJoinTables)
b.appendUnmatchedJoinHintWarning(HintINLJ, hintInfo.indexNestedLoopJoinTables)
b.appendUnmatchedJoinHintWarning(HintSMJ, hintInfo.sortMergeJoinTables)
b.appendUnmatchedJoinHintWarning(HintHJ, hintInfo.hashJoinTables)
b.tableHintInfo = b.tableHintInfo[:len(b.tableHintInfo)-1]
}

Expand Down
2 changes: 1 addition & 1 deletion planner/core/physical_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ func (s *testPlanSuite) TestJoinHints(c *C) {
{
sql: "select /*+ TIDB_INLJ(t1) */ t1.b, t2.a from t t1, t t2 where t1.b = t2.a;",
best: "LeftHashJoin{TableReader(Table(t))->TableReader(Table(t))}(test.t1.b,test.t2.a)",
warning: "[planner:1815]Optimizer Hint /*+ TIDB_INLJ(t1) */ is inapplicable",
warning: "[planner:1815]Optimizer Hint /*+ INL_JOIN(t1) */ is inapplicable",
},
}
ctx := context.Background()
Expand Down

0 comments on commit f69753e

Please sign in to comment.