File tree 2 files changed +9
-4
lines changed 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -10331,7 +10331,7 @@ impl<'a> Parser<'a> {
10331
10331
Expr :: Wildcard => Ok ( SelectItem :: Wildcard (
10332
10332
self . parse_wildcard_additional_options ( ) ?,
10333
10333
) ) ,
10334
- Expr :: Identifier ( v) if v. value . to_lowercase ( ) == "from" => {
10334
+ Expr :: Identifier ( v) if v. value . to_lowercase ( ) == "from" && v . quote_style . is_none ( ) => {
10335
10335
parser_err ! (
10336
10336
format!( "Expected an expression, found: {}" , v) ,
10337
10337
self . peek_token( ) . location
Original file line number Diff line number Diff line change @@ -9005,7 +9005,7 @@ fn parse_non_latin_identifiers() {
9005
9005
9006
9006
#[ test]
9007
9007
fn parse_trailing_comma ( ) {
9008
- // At the moment, Duck DB is the only dialect that allows
9008
+ // At the moment, DuckDB is the only dialect that allows
9009
9009
// trailing commas anywhere in the query
9010
9010
let trailing_commas = TestedDialects {
9011
9011
dialects : vec ! [ Box :: new( DuckDbDialect { } ) ] ,
@@ -9038,11 +9038,16 @@ fn parse_trailing_comma() {
9038
9038
) ;
9039
9039
9040
9040
trailing_commas. verified_stmt ( "SELECT album_id, name FROM track" ) ;
9041
-
9042
9041
trailing_commas. verified_stmt ( "SELECT * FROM track ORDER BY milliseconds" ) ;
9043
-
9044
9042
trailing_commas. verified_stmt ( "SELECT DISTINCT ON (album_id) name FROM track" ) ;
9045
9043
9044
+ // check quoted "from" identifier edge-case
9045
+ trailing_commas. one_statement_parses_to (
9046
+ r#"SELECT "from", FROM "from""# ,
9047
+ r#"SELECT "from" FROM "from""# ,
9048
+ ) ;
9049
+ trailing_commas. verified_stmt ( r#"SELECT "from" FROM "from""# ) ;
9050
+
9046
9051
// doesn't allow any trailing commas
9047
9052
let trailing_commas = TestedDialects {
9048
9053
dialects : vec ! [ Box :: new( GenericDialect { } ) ] ,
You can’t perform that action at this time.
0 commit comments