File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8700,13 +8700,12 @@ impl<'a> Parser<'a> {
87008700 ) ) ) ;
87018701 }
87028702 // [ [ NO ] CYCLE ]
8703- if self . parse_keywords ( & [ Keyword :: NO ] ) {
8704- if self . parse_keywords ( & [ Keyword :: CYCLE ] ) {
8705- sequence_options. push ( SequenceOptions :: Cycle ( true ) ) ;
8706- }
8703+ if self . parse_keywords ( & [ Keyword :: NO , Keyword :: CYCLE ] ) {
8704+ sequence_options. push ( SequenceOptions :: Cycle ( true ) ) ;
87078705 } else if self . parse_keywords ( & [ Keyword :: CYCLE ] ) {
87088706 sequence_options. push ( SequenceOptions :: Cycle ( false ) ) ;
87098707 }
8708+
87108709 Ok ( sequence_options)
87118710 }
87128711
Original file line number Diff line number Diff line change @@ -276,6 +276,11 @@ fn parse_create_sequence() {
276276 sql6,
277277 "CREATE TEMPORARY SEQUENCE IF NOT EXISTS name3 INCREMENT 1 NO MINVALUE MAXVALUE 20 OWNED BY NONE" ,
278278 ) ;
279+
280+ assert ! ( matches!(
281+ pg( ) . parse_sql_statements( "CREATE SEQUENCE foo INCREMENT 1 NO MINVALUE NO" ) ,
282+ Err ( ParserError :: ParserError ( _) )
283+ ) ) ;
279284}
280285
281286#[ test]
You can’t perform that action at this time.
0 commit comments