Skip to content

Cannot reference column in UPDATE due to case sensitive parsing of column #3017

Open
@Elettronik

Description

@Elettronik

Version

1.24.0

What happened?

When SQLite SQL statement are parsed, the column name in alter table statement have a different case than the others.
The culprit seems to be the following code:
while in create table the column name is passed through indentifier function,

Colname: identifier(def.Column_name().GetText()),

the alter table statement is not

name := def.Column_name().GetText()
stmt.Cmds.Items = append(stmt.Cmds.Items, &ast.AlterTableCmd{
Name: &name,
Subtype: ast.AT_AddColumn,
Def: &ast.ColumnDef{
Colname: name,

The problem that this will create is that is not possible to reference in an update statement the column added through ALTER TABLE statement

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

No response

What operating system are you using?

Linux

What database engines are you using?

SQLite

What type of code are you generating?

Go

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageNew issues that hasn't been reviewed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions