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(parser): disallow empty object names #8171
Conversation
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.
Generally LGTM. Thanks for your contribution!
where | ||
S: Into<String>, | ||
{ | ||
assert!(quote == '\'' || quote == '"' || quote == '`' || quote == '['); |
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.
I think we can keep the assertion?
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.
Well, if the function name is _unchecked, doesn't seem coherent to add assertions.
src/sqlparser/src/ast/mod.rs
Outdated
Ident { | ||
value: value.into(), | ||
quote_style: Some(quote), | ||
} | ||
} | ||
|
||
/// Create a new quoted identifier with the given quote and value. | ||
/// returns ParserError when the given string is empty or the given quote is illegal. | ||
pub fn new_with_quote_check<S>(quote: char, value: S) -> Result<Ident, ParserError> |
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.
Where is this function used? I didn't find that
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.
shoud I remove this function? it might be useful, and I just found this asymmetry jarring defining only a unchecked function
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Fix #6022
Checklist For Contributors
I have added fuzzing tests or opened an issue to track them. (Optional, recommended for new SQL features).I have demonstrated that backward compatibility is not broken by breaking changes and created issues to track deprecated features to be removed in the future. (Please refer to the issue)./risedev check
(or alias,./risedev c
)Checklist For Reviewers
[ ] I have requested macro/micro-benchmarks as this PR can affect performance substantially, and the results are shown.Documentation
Click here for Documentation
Types of user-facing changes
Please keep the types that apply to your changes, and remove the others.
Release note