You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use_toja should be able to be applied to a named query block
when we build a join, we will set the preferred join hint, we could see when join child are already a join with merged schema(different table name inside), it couldn't pass the extract alias check
func (p *LogicalJoin) setPreferredJoinTypeAndOrder(hintInfo *tableHintInfo) {
if hintInfo == nil {
return
}
lhsAlias := extractTableAlias(p.children[0], p.blockOffset)
rhsAlias := extractTableAlias(p.children[1], p.blockOffset)
func extractTableAlias(p Plan, parentOffset int) *hintTableInfo {
if len(p.OutputNames()) > 0 && p.OutputNames()[0].TblName.L != "" {
firstName := p.OutputNames()[0]
for _, name := range p.OutputNames() {
if name.TblName.L != firstName.TblName.L ||
(name.DBName.L != "" && firstName.DBName.L != "" && name.DBName.L != firstName.DBName.L) { // DBName can be nil, see #46160
return nil
}
}
as we see from the extractTableAlias, when the output name contains two different table, it will abort the extracting logic.
that's why case 7458 couldn't succeed.
The text was updated successfully, but these errors were encountered:
Enhancement
as we see from the extractTableAlias, when the output name contains two different table, it will abort the extracting logic.
that's why case 7458 couldn't succeed.
The text was updated successfully, but these errors were encountered: