Skip to content

Commit

Permalink
parser: support the ordered_hash_join hint (#35440)
Browse files Browse the repository at this point in the history
ref #35439
  • Loading branch information
Reminiscent authored Jun 16, 2022
1 parent 79d9d6f commit 255dc8c
Show file tree
Hide file tree
Showing 6 changed files with 612 additions and 583 deletions.
2 changes: 1 addition & 1 deletion parser/ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3550,7 +3550,7 @@ func (n *TableOptimizerHint) Restore(ctx *format.RestoreCtx) error {
ctx.WritePlainf("%d", n.HintData.(uint64))
case "nth_plan":
ctx.WritePlainf("%d", n.HintData.(int64))
case "tidb_hj", "tidb_smj", "tidb_inlj", "hash_join", "merge_join", "inl_join", "broadcast_join", "inl_hash_join", "inl_merge_join", "leading":
case "tidb_hj", "tidb_smj", "tidb_inlj", "hash_join", "ordered_hash_join", "merge_join", "inl_join", "broadcast_join", "inl_hash_join", "inl_merge_join", "leading":
for i, table := range n.Tables {
if i != 0 {
ctx.WritePlain(", ")
Expand Down
1 change: 1 addition & 0 deletions parser/ast/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ func TestTableOptimizerHintRestore(t *testing.T) {
{"INL_MERGE_JOIN(t1,t2)", "INL_MERGE_JOIN(`t1`, `t2`)"},
{"INL_JOIN(t1,t2)", "INL_JOIN(`t1`, `t2`)"},
{"HASH_JOIN(t1,t2)", "HASH_JOIN(`t1`, `t2`)"},
{"ORDERED_HASH_JOIN(t1,t2)", "ORDERED_HASH_JOIN(`t1`, `t2`)"},
{"LEADING(t1)", "LEADING(`t1`)"},
{"LEADING(t1, c1)", "LEADING(`t1`, `c1`)"},
{"LEADING(t1, c1, t2)", "LEADING(`t1`, `c1`, `t2`)"},
Expand Down
Loading

0 comments on commit 255dc8c

Please sign in to comment.