Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jan 6, 2024
1 parent 9b0fd9e commit 16a7d82
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/planner/core/casetest/hint/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_test(
],
data = glob(["testdata/**"]),
flaky = True,
shard_count = 6,
shard_count = 7,
deps = [
"//pkg/config",
"//pkg/domain",
Expand Down
10 changes: 10 additions & 0 deletions pkg/planner/core/casetest/hint/hint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,13 @@ func TestOptimizeHintOnPartitionTable(t *testing.T) {
tk.MustQuery("SELECT /*+ MAX_EXECUTION_TIME(10), dtc(name=tt) unknow(t1,t2) */ SLEEP(5)").Check(testkit.Rows("0"))
require.Len(t, tk.Session().GetSessionVars().StmtCtx.GetWarnings(), 2)
}

func TestIssue50067(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
tk.MustExec("use test")
tk.MustExec("create table t1 (a int);")
tk.MustExec("create table t2 (a int);")
tk.MustExec("create table t3 (a int);")
tk.MustExec("explain select * from t1, t2, t3 union all select /*+ leading(t3, t2) */ * from t1, t2, t3 union all select * from t1, t2, t3;")
}
2 changes: 2 additions & 0 deletions pkg/util/hint/hint_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func ExtractTableHintsFromStmtNode(node ast.Node, sctx sessionctx.Context) []*as
}
}
return result
case *ast.ExplainStmt:
return ExtractTableHintsFromStmtNode(x.Stmt, sctx)
default:
return nil
}
Expand Down

0 comments on commit 16a7d82

Please sign in to comment.