mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* fb-1940 re-implemented some changes that got missed private-public * fb-1939 fixes to between + decimals * fb-1935 - avg() on and id type + fixed some tests * fb-1953 add min/max for string types * fb-1938 - remove internal_type column from show columns * fb-1964 - fix space_used in fb_cluster_nodes to be int * fb-1996 - make sure all Idents that are being used as object references to schema objects are lowercased * fixed failing test * added some missed changes * fb-1969 found another case issue with identifier used for column idents
29 lines
1,009 B
Go
29 lines
1,009 B
Go
// Copyright 2021 Molecula Corp. All rights reserved.
|
|
|
|
package planner
|
|
|
|
import (
|
|
"context"
|
|
"strings"
|
|
|
|
pilosa "github.com/featurebasedb/featurebase/v3"
|
|
"github.com/featurebasedb/featurebase/v3/dax"
|
|
"github.com/featurebasedb/featurebase/v3/sql3"
|
|
"github.com/featurebasedb/featurebase/v3/sql3/parser"
|
|
"github.com/featurebasedb/featurebase/v3/sql3/planner/types"
|
|
)
|
|
|
|
// compileDropTableStatement compiles a DROP TABLE statement into a
|
|
// PlanOperator.
|
|
func (p *ExecutionPlanner) compileDropTableStatement(ctx context.Context, stmt *parser.DropTableStatement) (_ types.PlanOperator, err error) {
|
|
tableName := strings.ToLower(parser.IdentName(stmt.Name))
|
|
tname := dax.TableName(tableName)
|
|
tbl, err := p.schemaAPI.TableByName(ctx, tname)
|
|
if err != nil {
|
|
if isTableNotFoundError(err) {
|
|
return nil, sql3.NewErrTableNotFound(stmt.Name.NamePos.Line, stmt.Name.NamePos.Column, tableName)
|
|
}
|
|
return nil, err
|
|
}
|
|
return NewPlanOpQuery(p, NewPlanOpDropTable(p, pilosa.TableToIndexInfo(tbl)), p.sql), nil
|
|
}
|