New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix parsing CLOB, BINARY, VARBINARY, BLOB data type #618
Conversation
Pull Request Test Coverage Report for Build 3141114749
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this @ding-young -- the code looks good. Can you please add regression tests so that this syntax is not accidentally broken in the future?
Thank you
let sql = "SELECT CAST(id AS CLOB(50)) FROM customer"; | ||
let select = verified_only_select(sql); | ||
assert_eq!( | ||
&Expr::Cast { | ||
expr: Box::new(Expr::Identifier(Ident::new("id"))), | ||
data_type: DataType::Clob(50) | ||
}, | ||
expr_from_projection(only(&select.projection)) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alamb I added test cases for parse_cast
with these data types since I could not find test fn parse_datatype
.. Thanks for review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM -- thanks @ding-young
The same for This seems a regression of support for me. |
Thanks for the report @AugustoFKL -- any chance you can make a PR to fix it? |
@alamb sure, I can do it today I also need to add precision to I don't like to do multiple things in one PR, so I'll possibly open two (or one for each one?) |
Multiple small PRs would be most preferable. 🙏 |
Related Issue
Resolves #518
Description
Parse error occurs for
CLOB
,BINARY
,VARBINARY
, andBLOB
data types though they are included as variants for data type & keywords in sqlparser. Since all these 4 data types contain (non-optional) u64 value, addedparse_precision
fn.