Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# package querytest
query.sql:9:1: column reference "invalid_reference" not found
query.sql:11:10: column reference "invalid_reference" not found
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# package querytest
query.sql:9:1: table alias "p" does not exist
query.sql:11:9: table alias "p" does not exist
10 changes: 7 additions & 3 deletions internal/engine/sqlite/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ func (c *cc) convertColumnNameExpr(n *parser.Expr_qualified_column_nameContext)
Fields: &ast.List{
Items: items,
},
Location: n.GetStart().GetStart(),
}
}

Expand Down Expand Up @@ -545,15 +546,17 @@ func (c *cc) convertLiteral(n *parser.Expr_literalContext) ast.Node {
if literal.NUMERIC_LITERAL() != nil {
i, _ := strconv.ParseInt(literal.GetText(), 10, 64)
return &ast.A_Const{
Val: &ast.Integer{Ival: i},
Val: &ast.Integer{Ival: i},
Location: n.GetStart().GetStart(),
}
}

if literal.STRING_LITERAL() != nil {
// remove surrounding single quote
text := literal.GetText()
return &ast.A_Const{
Val: &ast.String{Str: text[1 : len(text)-1]},
Val: &ast.String{Str: text[1 : len(text)-1]},
Location: n.GetStart().GetStart(),
}
}

Expand All @@ -564,7 +567,8 @@ func (c *cc) convertLiteral(n *parser.Expr_literalContext) ast.Node {
}

return &ast.A_Const{
Val: &ast.Integer{Ival: i},
Val: &ast.Integer{Ival: i},
Location: n.GetStart().GetStart(),
}
}
}
Expand Down