Documentation ¶
Index ¶
- Constants
- Variables
- func InferType(node ast.Node) error
- func Optimize(ctx context.Context, node ast.Node, sb plan.SubQueryBuilder) (plan.Plan, error)
- func Prepare(is infoschema.InfoSchema, ctx context.Context, node ast.Node) error
- func Preprocess(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
- func ResolveName(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
- func Validate(node ast.Node, inPrepare bool) error
Constants ¶
View Source
const ( CodeOneColumn terror.ErrCode = 1 CodeSameColumns terror.ErrCode = 2 CodeMultiWildCard terror.ErrCode = 3 CodeUnsupported terror.ErrCode = 4 CodeInvalidGroupFuncUse terror.ErrCode = 5 CodeIllegalReference terror.ErrCode = 6 )
Optimizer error codes.
Variables ¶
View Source
var ( ErrOneColumn = terror.ClassOptimizer.New(CodeOneColumn, "Operand should contain 1 column(s)") ErrSameColumns = terror.ClassOptimizer.New(CodeSameColumns, "Operands should contain same columns") ErrMultiWildCard = terror.ClassOptimizer.New(CodeMultiWildCard, "wildcard field exist more than once") ErrUnSupported = terror.ClassOptimizer.New(CodeUnsupported, "unsupported") ErrInvalidGroupFuncUse = terror.ClassOptimizer.New(CodeInvalidGroupFuncUse, "Invalid use of group function") ErrIllegalReference = terror.ClassOptimizer.New(CodeIllegalReference, "Illegal reference") )
Optimizer base errors.
Functions ¶
func Prepare ¶
func Prepare(is infoschema.InfoSchema, ctx context.Context, node ast.Node) error
Prepare prepares a raw statement parsed from parser. The statement must be prepared before it can be passed to optimize function. We pass InfoSchema instead of getting from Context in case it is changed after resolving name.
func Preprocess ¶
func Preprocess(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
Preprocess does preprocess work for optimizer.
func ResolveName ¶
func ResolveName(node ast.Node, info infoschema.InfoSchema, ctx context.Context) error
ResolveName resolves table name and column name. It generates ResultFields for ResultSetNode and resolves ColumnNameExpr to a ResultField.
Types ¶
This section is empty.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.