File tree 3 files changed +17
-2
lines changed
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 {
350
350
}
351
351
}
352
352
353
- write ! ( f, " {}" , display_comma_separated( & self . projection) ) ?;
353
+ if !self . projection . is_empty ( ) {
354
+ write ! ( f, " {}" , display_comma_separated( & self . projection) ) ?;
355
+ }
354
356
355
357
if let Some ( ref into) = self . into {
356
358
write ! ( f, " {into}" ) ?;
Original file line number Diff line number Diff line change @@ -9604,7 +9604,15 @@ impl<'a> Parser<'a> {
9604
9604
top = Some(self.parse_top()?);
9605
9605
}
9606
9606
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()?;
9608
9616
9609
9617
let into = if self.parse_keyword(Keyword::INTO) {
9610
9618
let temporary = self
Original file line number Diff line number Diff line change @@ -5195,3 +5195,8 @@ fn parse_bitstring_literal() {
5195
5195
) ) ]
5196
5196
) ;
5197
5197
}
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