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
Allow parsing of mysql empty row inserts #783
Conversation
Pull Request Test Coverage Report for Build 3816502109
💛 - 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.
Looks good to me - thanks @Jefffrey
I actually think we could allow the empty values list for all dialects (not just MySQL) per the https://github.com/sqlparser-rs/sqlparser-rs#syntax-vs-semantics section
That would keep this PR smaller and the sqlparser-rs code simpler
What do you think?
let cols = self.parse_comma_separated(Parser::parse_identifier)?; | ||
self.expect_token(&Token::RParen)?; | ||
Ok(cols) | ||
if allow_empty && self.peek_token().token == Token::RParen { |
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.
👍
One thing I noticed however, was for postgresql it would be a parser exception. For example, when running: insert into tb () values (); Get exception
Similarly, for the same in MSSql:
So seems to suggest that for these dialects, it shouldn't parse at all. Thus, I'm a bit hesitant on enabling for all dialects. Not to mention, that the methods modified ( sqlparser-rs/tests/sqlparser_bigquery.rs Lines 314 to 320 in 86d71f2
So those methods would still likely require the new |
Closes #624
Allows parsing of
for MySql dialect