Skip to content

Commit

Permalink
This is an automated cherry-pick of pingcap#50260
Browse files Browse the repository at this point in the history
Signed-off-by: ti-chi-bot <[email protected]>
  • Loading branch information
hawkingrei authored and ti-chi-bot committed Jan 10, 2024
1 parent 4a8c7b2 commit d738a06
Show file tree
Hide file tree
Showing 3 changed files with 657 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4199,6 +4199,7 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev
b.ctx.GetSessionVars().StmtCtx.AppendWarning(ErrInternal.GenWithStack("We can only use the straight_join hint, when we use the leading hint and straight_join hint at the same time, all leading hints will be invalid"))
}
}
<<<<<<< HEAD
b.tableHintInfo = append(b.tableHintInfo, tableHintInfo{
sortMergeJoinTables: sortMergeTables,
broadcastJoinTables: bcTables,
Expand All @@ -4215,6 +4216,24 @@ func (b *PlanBuilder) pushTableHints(hints []*ast.TableOptimizerHint, currentLev
indexMergeHintList: indexMergeHintList,
timeRangeHint: timeRangeHint,
limitHints: limitHints,
=======
b.tableHintInfo = append(b.tableHintInfo, h.TableHintInfo{
SortMergeJoinTables: sortMergeTables,
BroadcastJoinTables: bcTables,
ShuffleJoinTables: shuffleJoinTables,
IndexNestedLoopJoinTables: h.IndexNestedLoopJoinTables{INLJTables: inljTables, INLHJTables: inlhjTables, INLMJTables: inlmjTables},
NoIndexJoinTables: h.IndexNestedLoopJoinTables{INLJTables: noIndexJoinTables, INLHJTables: noIndexHashJoinTables, INLMJTables: noIndexMergeJoinTables},
HashJoinTables: hashJoinTables,
NoHashJoinTables: noHashJoinTables,
NoMergeJoinTables: noMergeJoinTables,
IndexHintList: indexHintList,
TiFlashTables: tiflashTables,
TiKVTables: tikvTables,
AggHints: aggHints,
IndexMergeHintList: indexMergeHintList,
TimeRangeHint: timeRangeHint,
LimitHints: limitHints,
>>>>>>> d5057042071 (Revert "planner: fix leading hint cannot take effect in UNION ALL statements" (#50260))
MergeHints: MergeHints,
leadingJoinOrder: leadingJoinOrder,
hjBuildTables: hjBuildTables,
Expand Down
4 changes: 4 additions & 0 deletions pkg/planner/core/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,11 @@ type PlanBuilder struct {
colMapper map[*ast.ColumnNameExpr]int
// visitInfo is used for privilege check.
visitInfo []visitInfo
<<<<<<< HEAD
tableHintInfo []tableHintInfo
=======
tableHintInfo []hint.TableHintInfo
>>>>>>> d5057042071 (Revert "planner: fix leading hint cannot take effect in UNION ALL statements" (#50260))
// optFlag indicates the flags of the optimizer rules.
optFlag uint64
// capFlag indicates the capability flags.
Expand Down
Loading

0 comments on commit d738a06

Please sign in to comment.