mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-11 15:21:02 +00:00
Reverted first hack, this treats the identifiers as case neutral during the planning stage.
This commit is contained in:
parent
a30f59d5f7
commit
070efb9bef
4 changed files with 9 additions and 5 deletions
|
|
@ -1593,6 +1593,10 @@ func IdentName(ident *Ident) string {
|
|||
return ident.Name
|
||||
}
|
||||
|
||||
func CaseNeutralIdentName(ident *Ident) string {
|
||||
return strings.ToLower(IdentName(ident))
|
||||
}
|
||||
|
||||
type Variable struct {
|
||||
NamePos Pos // variable position
|
||||
Name string // variable name
|
||||
|
|
|
|||
|
|
@ -1543,7 +1543,7 @@ func (p *Parser) parseIdent(desc string) (*Ident, error) {
|
|||
pos, tok, lit := p.scan()
|
||||
switch tok {
|
||||
case IDENT, QIDENT:
|
||||
return &Ident{Name: strings.ToLower(lit), NamePos: pos, Quoted: tok == QIDENT}, nil
|
||||
return &Ident{Name: lit, NamePos: pos, Quoted: tok == QIDENT}, nil
|
||||
default:
|
||||
return nil, p.errorExpected(pos, tok, desc)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ type createTableField struct {
|
|||
// compileCreateTableStatement compiles a CREATE TABLE statement into a
|
||||
// PlanOperator.
|
||||
func (p *ExecutionPlanner) compileCreateTableStatement(stmt *parser.CreateTableStatement) (_ types.PlanOperator, err error) {
|
||||
tableName := parser.IdentName(stmt.Name)
|
||||
tableName := parser.CaseNeutralIdentName(stmt.Name)
|
||||
failIfExists := !stmt.IfNotExists.IsValid()
|
||||
|
||||
// apply table options
|
||||
|
|
@ -50,7 +50,7 @@ func (p *ExecutionPlanner) compileCreateTableStatement(stmt *parser.CreateTableS
|
|||
|
||||
var columns = []*createTableField{}
|
||||
for _, col := range stmt.Columns {
|
||||
columnName := parser.IdentName(col.Name)
|
||||
columnName := parser.CaseNeutralIdentName(col.Name)
|
||||
typeName := parser.IdentName(col.Type.Name)
|
||||
|
||||
if strings.ToLower(columnName) == "_id" {
|
||||
|
|
@ -77,7 +77,7 @@ func (p *ExecutionPlanner) compileCreateTableStatement(stmt *parser.CreateTableS
|
|||
// compiles a column def
|
||||
func (p *ExecutionPlanner) compileColumn(col *parser.ColumnDefinition) (*createTableField, error) {
|
||||
var err error
|
||||
columnName := parser.IdentName(col.Name)
|
||||
columnName := parser.CaseNeutralIdentName(col.Name)
|
||||
typeName := parser.IdentName(col.Type.Name)
|
||||
|
||||
column := &createTableField{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import (
|
|||
// compileDropTableStatement compiles a DROP TABLE statement into a
|
||||
// PlanOperator.
|
||||
func (p *ExecutionPlanner) compileDropTableStatement(stmt *parser.DropTableStatement) (_ types.PlanOperator, err error) {
|
||||
tableName := parser.IdentName(stmt.Name)
|
||||
tableName := parser.CaseNeutralIdentName(stmt.Name)
|
||||
tname := dax.TableName(tableName)
|
||||
tbl, err := p.schemaAPI.TableByName(context.Background(), tname)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue