File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20586,9 +20586,9 @@ impl<'a> Parser<'a> {
2058620586 return self.expected_ref("number, name or string", self.peek_token_ref());
2058720587 }
2058820588 }
20589- match self.maybe_parse (|parser| parser.parse_value())? {
20590- Some (value) => Ok(Expr::Value(value)),
20591- None => Ok(Expr::Identifier(self.parse_identifier()?)),
20589+ match self.try_parse (|parser| parser.parse_value()) {
20590+ Ok (value) => Ok(Expr::Value(value)),
20591+ Err(_) => Ok(Expr::Identifier(self.parse_identifier()?)),
2059220592 }
2059320593 }
2059420594
Original file line number Diff line number Diff line change @@ -1335,8 +1335,20 @@ fn pragma_values() {
13351335 "PRAGMA x = NULL" ,
13361336 "Expected: number, name or string, found: NULL" ,
13371337 ) ,
1338+ ( "PRAGMA x()" , "Expected: identifier, found: )" ) ,
1339+ ( "PRAGMA x = )" , "Expected: identifier, found: )" ) ,
1340+ ( "PRAGMA x(=)" , "Expected: identifier, found: =" ) ,
13381341 ] {
13391342 let actual = sqlite_and_generic ( ) . parse_sql_statements ( sql) . unwrap_err ( ) ;
13401343 assert ! ( actual. to_string( ) . contains( error) , "{sql}: {actual}" ) ;
13411344 }
13421345}
1346+
1347+ #[ cfg( feature = "bigdecimal" ) ]
1348+ #[ test]
1349+ fn pragma_values_reject_unrepresentable_signed_numbers ( ) {
1350+ let error = sqlite_and_generic ( )
1351+ . parse_sql_statements ( "PRAGMA x = -1e999999999999999999999999" )
1352+ . unwrap_err ( ) ;
1353+ assert ! ( matches!( error, ParserError :: ParserError ( _) ) ) ;
1354+ }
You can’t perform that action at this time.
0 commit comments