// matchTableName checks whether the hint hit the need.
// Only need either side matches one on the list.
// Even though you can put 2 tables on the list,
// it doesn't mean optimizer will reorder to make them
// join directly.
// Which it joins on with depend on sequence of traverse
// and without reorder, user might adjust themselves.
// This is similar to MySQL hints.
matchTableName checks whether the hint hit the need.
Only need either side matches one on the list.
Even though you can put 2 tables on the list,
it doesn't mean optimizer will reorder to make them
join directly.
Which it joins on with depend on sequence of traverse
and without reorder, user might adjust themselves.
This is similar to MySQL hints.
// matchTableName checks whether the hint hit the need . // Only need either side matches one on the list . // Even though you can put 2 tables on the list // it doesn ' t mean optimizer will reorder to make them // join directly . // Which it joins on with depend on sequence of traverse // and without reorder user might adjust themselves . // This is similar to MySQL hints .
func (info *tableHintInfo) matchTableName(tables []*hintTableInfo, hintTables []hintTableInfo) bool {
	hintMatched := false
	for _, table := range tables {
		for i, curEntry := range hintTables {
			if table == nil {
				continue
			}
			if curEntry.dbName.L == table.dbName.L && curEntry.tblName.L == table.tblName.L && table.selectOffset == curEntry.selectOffset {
				hintTables[i].matched = true
				hintMatched = true
				break
			}
		}
	}
	return hintMatched
}
func ( info * tableHintInfo ) matchTableName ( tables [ ] * hintTableInfo , hintTables [ ] hintTableInfo ) bool { hintMatched := false for _ , table := range tables { for i , curEntry := range hintTables { if table == nil { continue } if curEntry . dbName . L == table . dbName . L && curEntry . tblName . L == table . tblName . L && table . selectOffset == curEntry . selectOffset { hintTables [ i ] . matched = true hintMatched = true break } } } return hintMatched }
matchTableName checks whether the hint hit the need.
matchTableName checks whether the hint hit the need .