Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: TennyZhuang <[email protected]>
  • Loading branch information
TennyZhuang committed May 24, 2024
1 parent cc9dbc3 commit d8b7d60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/sqlparser/src/parser_v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ where
S: TokenStream,
{
preceded(
take_while(0.., |token| matches!(token.token, Token::Whitespace(_))),
take_while(0.., |token: TokenWithLocation| {
matches!(token.token, Token::Whitespace(_))
}),
any_token,
)
.parse_next(input)
Expand Down
2 changes: 1 addition & 1 deletion src/sqlparser/src/parser_v2/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ where
S: TokenStream,
{
#[derive(Debug, thiserror::Error)]
#[error("Precision must be in range '{0}'")]
#[error("Precision must be in range {0}")]
struct OutOfRange(String);

delimited(
Expand Down
4 changes: 2 additions & 2 deletions src/sqlparser/tests/testdata/select.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
- input: SELECT 0x
error_msg: 'sql parser error: incomplete integer literal at Line: 1, Column 8'
- input: SELECT 1::float(0)
error_msg: 'sql parser error: Unexpected 0 at line:1, column:17: Precision must be in range "1..54"'
error_msg: 'sql parser error: Unexpected 0 at line:1, column:17: Precision must be in range 1..54'
- input: SELECT 1::float(54)
error_msg: 'sql parser error: Unexpected 54 at line:1, column:18: Precision must be in range "1..54"'
error_msg: 'sql parser error: Unexpected 54 at line:1, column:18: Precision must be in range 1..54'
- input: SELECT 1::int(2)
error_msg: |-
sql parser error: Expected end of statement, found: ( at line:1, column:14
Expand Down

0 comments on commit d8b7d60

Please sign in to comment.