File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -350,7 +350,9 @@ impl fmt::Display for Select {
350350 }
351351 }
352352
353- write ! ( f, " {}" , display_comma_separated( & self . projection) ) ?;
353+ if !self . projection . is_empty ( ) {
354+ write ! ( f, " {}" , display_comma_separated( & self . projection) ) ?;
355+ }
354356
355357 if let Some ( ref into) = self . into {
356358 write ! ( f, " {into}" ) ?;
Original file line number Diff line number Diff line change @@ -9604,7 +9604,15 @@ impl<'a> Parser<'a> {
96049604 top = Some(self.parse_top()?);
96059605 }
96069606
9607- let projection = self.parse_projection()?;
9607+ let projection = if dialect_of!(self is PostgreSqlDialect | GenericDialect)
9608+ && self.peek_keyword(Keyword::FROM)
9609+ {
9610+ vec![]
9611+ } else {
9612+ self.parse_projection()?
9613+ };
9614+
9615+ // let projection = self.parse_projection()?;
96089616
96099617 let into = if self.parse_keyword(Keyword::INTO) {
96109618 let temporary = self
Original file line number Diff line number Diff line change @@ -5195,3 +5195,8 @@ fn parse_bitstring_literal() {
51955195 ) ) ]
51965196 ) ;
51975197}
5198+
5199+ #[ test]
5200+ fn parse_select_without_projection ( ) {
5201+ pg_and_generic ( ) . verified_stmt ( "SELECT FROM users" ) ;
5202+ }
You can’t perform that action at this time.
0 commit comments