Documentation ¶
Overview ¶
Package resolve is used for semantic resolve of the AST tree. semantic resolve is mostly done by 'core.preprocessor', in tableListExtractor and updatableTableListResolver we also do some resolve for aliases.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is used to store the context and result of resolving AST tree.
func (*Context) AddTableName ¶
func (c *Context) AddTableName(tableNameW *TableNameW)
AddTableName adds the AST table name and its corresponding TableNameW to the Context.
func (*Context) GetTableName ¶
func (c *Context) GetTableName(tableName *ast.TableName) *TableNameW
GetTableName returns the TableNameW of the AST table name. the TableNameW should have been added to the Context in pre-process phase before calling this function, if it doesn't exist, pre-process should have returned error, so we don't check nil-ness in most cases.
type NodeW ¶
NodeW is a wrapper around ast.Node to store resolve context.
func NewNodeWWithCtx ¶
NewNodeWWithCtx creates a NodeW with the given Context.
func (*NodeW) CloneWithNewNode ¶
CloneWithNewNode creates a new NodeW with the given ast.Node.
func (*NodeW) GetResolveContext ¶
GetResolveContext returns the Context of the NodeW.
type ResultField ¶
type ResultField struct { Column *model.ColumnInfo ColumnAsName pmodel.CIStr // EmptyOrgName indicates whether this field has an empty org_name. A field has an empty org name, if it's an // expression. It's not sure whether it's safe to use empty string in `.Column.Name`, so a new field is added to // indicate whether it's empty. EmptyOrgName bool Table *model.TableInfo TableAsName pmodel.CIStr DBName pmodel.CIStr }
ResultField represents a result field which can be a column from a table, or an expression in select field. It is a generated property during binding process. ResultField is the key element to evaluate a ColumnNameExpr. After resolving process, every ColumnNameExpr will be resolved to a ResultField. During execution, every row retrieved from table will set the row value to ResultFields of that table, so ColumnNameExpr resolved to that ResultField can be easily evaluated.