Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Aug 21, 2023
1 parent 8aaa96b commit 19b47ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 10 additions & 0 deletions executor/index_lookup_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,16 @@ func TestInapplicableIndexJoinHint(t *testing.T) {
tk.MustQuery(`show warnings;`).Check(testkit.Rows(`Warning 1815 Optimizer Hint /*+ INL_MERGE_JOIN(t1) */ is inapplicable`))
tk.MustQuery(`select /*+ INL_MERGE_JOIN(t2) */ * from t1 right join t2 on t1.a=t2.a;`).Check(testkit.Rows())
tk.MustQuery(`show warnings;`).Check(testkit.Rows(`Warning 1815 Optimizer Hint /*+ INL_MERGE_JOIN(t2) */ is inapplicable`))

// Test for issues/46160
tk.MustExec(`drop table if exists t1, t2;`)
tk.MustExec("use test")
tk.MustExec(`create table t1 (a int, key(a))`)
tk.MustExec(`create table t2 (a int, key(a))`)

query := `select /*+ tidb_inlj(bb) */ aa.* from (select * from t1) as aa left join
(select t2.a, t2.a*2 as a2 from t2) as bb on aa.a=bb.a;`
tk.HasPlan(query, "IndexJoin")
}

func TestIndexJoinOverflow(t *testing.T) {
Expand Down
13 changes: 0 additions & 13 deletions planner/core/casetest/hint/hint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,3 @@ func TestInvalidHint(t *testing.T) {
tk.MustQuery(tt).Check(testkit.Rows(output[i].Plan...))
}
}

func TestIssue46160(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)

tk.MustExec("use test")
tk.MustExec(`create table t1 (a int, key(a))`)
tk.MustExec(`create table t2 (a int, key(a))`)

query := `select /*+ tidb_inlj(bb) */ aa.* from (select * from t1) as aa left join
(select t2.a, t2.a*2 as a2 from t2) as bb on aa.a=bb.a;`
tk.HasPlan(query, "IndexJoin")
}

0 comments on commit 19b47ab

Please sign in to comment.