Skip to content

Commit 96fa7e6

Browse files
author
James Cor
committed
remove resolveDescribeQuery rule
1 parent fc9e96e commit 96fa7e6

File tree

4 files changed

+8
-41
lines changed

4 files changed

+8
-41
lines changed

sql/analyzer/analyzer.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,14 @@ func newInsertSourceSelector(sel RuleSelector) RuleSelector {
463463

464464
// Analyze applies the transformation rules to the node given. In the case of an error, the last successfully
465465
// transformed node is returned along with the error.
466-
func (a *Analyzer) Analyze(ctx *sql.Context, n sql.Node, scope *plan.Scope, qFlags *sql.QueryFlags) (sql.Node, error) {
467-
n, _, err := a.analyzeWithSelector(ctx, n, scope, SelectAllBatches, DefaultRuleSelector, qFlags)
468-
return n, err
466+
func (a *Analyzer) Analyze(ctx *sql.Context, node sql.Node, scope *plan.Scope, qFlags *sql.QueryFlags) (sql.Node, error) {
467+
switch n := node.(type) {
468+
case *plan.DescribeQuery:
469+
child, _, err := a.analyzeWithSelector(ctx, n.Query(), scope, SelectAllBatches, DefaultRuleSelector, qFlags)
470+
return n.WithQuery(child), err
471+
}
472+
node, _, err := a.analyzeWithSelector(ctx, node, scope, SelectAllBatches, DefaultRuleSelector, qFlags)
473+
return node, err
469474
}
470475

471476
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) {

sql/analyzer/describe.go

Lines changed: 0 additions & 36 deletions
This file was deleted.

sql/analyzer/rule_ids.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const (
1919
resolveCreateSelectId // resolveCreateSelect
2020
resolveSubqueriesId // resolveSubqueries
2121
resolveUnionsId // resolveUnions
22-
resolveDescribeQueryId // resolveDescribeQuery
2322
ValidateColumnDefaultsId // validateColumnDefaults
2423
validateCreateTriggerId // validateCreateTrigger
2524
validateCreateProcedureId // validateCreateProcedure

sql/analyzer/rules.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ var OnceBeforeDefault = []Rule{
4646
{resolveCreateSelectId, resolveCreateSelect},
4747
{validateDropConstraintId, validateDropConstraint},
4848
{resolveUnionsId, resolveUnions},
49-
{resolveDescribeQueryId, resolveDescribeQuery}, //TODO
5049
{validateCreateTriggerId, validateCreateTrigger},
5150
{ValidateColumnDefaultsId, validateColumnDefaults},
5251
{validateReadOnlyDatabaseId, validateReadOnlyDatabase},

0 commit comments

Comments
 (0)