File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -7274,6 +7274,16 @@ impl<'a> Parser<'a> {
7274
7274
let placeholder = tok. to_string ( ) + & ident. value ;
7275
7275
Ok ( Value :: Placeholder ( placeholder) )
7276
7276
}
7277
+ tok @ Token :: Minus => {
7278
+ let next_token = self . next_token ( ) ;
7279
+ match next_token. token {
7280
+ Token :: Number ( n, l) => Ok ( Value :: Number (
7281
+ Self :: parse :: < String > ( tok. to_string ( ) + & n, location) ?,
7282
+ l,
7283
+ ) ) ,
7284
+ _ => self . expected ( "number" , next_token) ,
7285
+ }
7286
+ }
7277
7287
unexpected => self . expected (
7278
7288
"a value" ,
7279
7289
TokenWithLocation {
Original file line number Diff line number Diff line change @@ -277,6 +277,16 @@ fn parse_create_sequence() {
277
277
"CREATE TEMPORARY SEQUENCE IF NOT EXISTS name3 INCREMENT 1 NO MINVALUE MAXVALUE 20 OWNED BY NONE" ,
278
278
) ;
279
279
280
+ let sql7 = "CREATE SEQUENCE name4
281
+ AS BIGINT
282
+ INCREMENT -10
283
+ MINVALUE - 2000 MAXVALUE -5
284
+ START WITH - 20" ;
285
+ pg ( ) . one_statement_parses_to (
286
+ sql7,
287
+ "CREATE SEQUENCE name4 AS BIGINT INCREMENT -10 MINVALUE -2000 MAXVALUE -5 START WITH -20" ,
288
+ ) ;
289
+
280
290
assert ! ( matches!(
281
291
pg( ) . parse_sql_statements( "CREATE SEQUENCE foo INCREMENT 1 NO MINVALUE NO" ) ,
282
292
Err ( ParserError :: ParserError ( _) )
You can’t perform that action at this time.
0 commit comments