Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions sql/analyzer/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,14 @@ func newInsertSourceSelector(sel RuleSelector) RuleSelector {

// Analyze applies the transformation rules to the node given. In the case of an error, the last successfully
// transformed node is returned along with the error.
func (a *Analyzer) Analyze(ctx *sql.Context, n sql.Node, scope *plan.Scope, qFlags *sql.QueryFlags) (sql.Node, error) {
n, _, err := a.analyzeWithSelector(ctx, n, scope, SelectAllBatches, DefaultRuleSelector, qFlags)
return n, err
func (a *Analyzer) Analyze(ctx *sql.Context, node sql.Node, scope *plan.Scope, qFlags *sql.QueryFlags) (sql.Node, error) {
switch n := node.(type) {
case *plan.DescribeQuery:
child, _, err := a.analyzeWithSelector(ctx, n.Query(), scope, SelectAllBatches, DefaultRuleSelector, qFlags)
return n.WithQuery(child), err
}
node, _, err := a.analyzeWithSelector(ctx, node, scope, SelectAllBatches, DefaultRuleSelector, qFlags)
return node, err
}

func (a *Analyzer) analyzeThroughBatch(ctx *sql.Context, n sql.Node, scope *plan.Scope, until string, sel RuleSelector, qFlags *sql.QueryFlags) (sql.Node, transform.TreeIdentity, error) {
Expand Down
36 changes: 0 additions & 36 deletions sql/analyzer/describe.go

This file was deleted.

1 change: 0 additions & 1 deletion sql/analyzer/rule_ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const (
resolveCreateSelectId // resolveCreateSelect
resolveSubqueriesId // resolveSubqueries
resolveUnionsId // resolveUnions
resolveDescribeQueryId // resolveDescribeQuery
ValidateColumnDefaultsId // validateColumnDefaults
validateCreateTriggerId // validateCreateTrigger
validateCreateProcedureId // validateCreateProcedure
Expand Down
123 changes: 61 additions & 62 deletions sql/analyzer/ruleid_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion sql/analyzer/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ var OnceBeforeDefault = []Rule{
{resolveCreateSelectId, resolveCreateSelect},
{validateDropConstraintId, validateDropConstraint},
{resolveUnionsId, resolveUnions},
{resolveDescribeQueryId, resolveDescribeQuery}, //TODO
{validateCreateTriggerId, validateCreateTrigger},
{ValidateColumnDefaultsId, validateColumnDefaults},
{validateReadOnlyDatabaseId, validateReadOnlyDatabase},
Expand Down