Skip to content

Commit 6a3ed8b

Browse files
committed
fix(engine/sqlite): To lowercase ast.ResTarget.Name
The SQLite engine lowercases ast.ResTarget.Name to match the behavior of pg_query. fix #2120
1 parent d12db53 commit 6a3ed8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/engine/sqlite/convert.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ func (c *cc) getCols(core *parser.Select_coreContext) []ast.Node {
426426
}
427427

428428
if col.AS_() != nil {
429-
name := col.Column_alias().GetText()
429+
name := identifier(col.Column_alias().GetText())
430430
target.Name = &name
431431
}
432432

@@ -738,7 +738,7 @@ func (c *cc) convertExprLists(lists []parser.IExprContext) *ast.List {
738738
func (c *cc) convertColumnNames(cols []parser.IColumn_nameContext) *ast.List {
739739
list := &ast.List{Items: []ast.Node{}}
740740
for _, c := range cols {
741-
name := c.GetText()
741+
name := identifier(c.GetText())
742742
list.Items = append(list.Items, &ast.ResTarget{
743743
Name: &name,
744744
})
@@ -841,7 +841,7 @@ func (c *cc) convertUpdate_stmtContext(n Update_stmt) ast.Node {
841841

842842
list := &ast.List{}
843843
for i, col := range n.AllColumn_name() {
844-
colName := col.GetText()
844+
colName := identifier(col.GetText())
845845
target := &ast.ResTarget{
846846
Name: &colName,
847847
Val: c.convert(n.Expr(i)),

0 commit comments

Comments
 (0)