func CreateTableNameDecorator(n *ast.TableName, rule router.Rule, result *RouteResult) (*TableNameDecorator, error) {
	if len(n.PartitionNames) != 0 {
		return nil, fmt.Errorf("TableName does not support PartitionNames in sharding")
	}
	ret := &TableNameDecorator{
		origin: n,
		rule:   rule,
		result: result,
	}
	return ret, nil
}
CreateTableNameDecorator create TableNameDecorator
the table has been checked before
package plan
import (
	"fmt"
	"github.com/XiaoMi/Gaea/parser/ast"
	"github.com/XiaoMi/Gaea/parser/format"
	"github.com/XiaoMi/Gaea/proxy/router"
	"github.com/pingcap/errors"
)
type TableNameDecorator struct {
	origin *ast.TableName
	rule   router.Rule
	result *RouteResult
}
func NeedCreateTableNameDecoratorWithoutAlias(p *StmtInfo, n *ast.TableName) (router.Rule, bool, error) {
	db, table := getTableInfoFromTableName(n)
	rule, err := p.RecordShardTable(db, table)
	if err != nil {
		return nil, false, fmt.Errorf("record shard table in SelectPlan error, db: %s, table, %s, err: %v", db, table, err)
	}
	return rule, true, nil
}
func NeedCreateTableNameDecorator(p *TableAliasStmtInfo, n *ast.TableName, alias string) (router.Rule, bool, error) {
	db, table := getTableInfoFromTableName(n)
	rule, err := p.RecordShardTable(db, table, alias)
	if err != nil {
		return nil, false, fmt.Errorf("record shard table in SelectPlan error, db: %s, table, %s, alias: %s, err: %v", db, table, alias, err)
	}
	return rule, true, nil
}