File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10331,7 +10331,7 @@ impl<'a> Parser<'a> {
1033110331 Expr :: Wildcard => Ok ( SelectItem :: Wildcard (
1033210332 self . parse_wildcard_additional_options ( ) ?,
1033310333 ) ) ,
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 ( ) => {
1033510335 parser_err ! (
1033610336 format!( "Expected an expression, found: {}" , v) ,
1033710337 self . peek_token( ) . location
Original file line number Diff line number Diff line change @@ -9005,7 +9005,7 @@ fn parse_non_latin_identifiers() {
90059005
90069006#[ test]
90079007fn 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
90099009 // trailing commas anywhere in the query
90109010 let trailing_commas = TestedDialects {
90119011 dialects : vec ! [ Box :: new( DuckDbDialect { } ) ] ,
@@ -9038,11 +9038,16 @@ fn parse_trailing_comma() {
90389038 ) ;
90399039
90409040 trailing_commas. verified_stmt ( "SELECT album_id, name FROM track" ) ;
9041-
90429041 trailing_commas. verified_stmt ( "SELECT * FROM track ORDER BY milliseconds" ) ;
9043-
90449042 trailing_commas. verified_stmt ( "SELECT DISTINCT ON (album_id) name FROM track" ) ;
90459043
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+
90469051 // doesn't allow any trailing commas
90479052 let trailing_commas = TestedDialects {
90489053 dialects : vec ! [ Box :: new( GenericDialect { } ) ] ,
You can’t perform that action at this time.
0 commit comments