mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-09-11 16:36:20 +00:00
Support MySQL ROWS
syntax for VALUES
(#737)
* Adapt VALUES to MySQL dialect * Update src/ast/query.rs Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org> * remove *requirement* for ROW Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
This commit is contained in:
parent
faf75b7161
commit
8e1c90c0d8
5 changed files with 72 additions and 35 deletions
|
@ -5642,13 +5642,19 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
|
||||
pub fn parse_values(&mut self) -> Result<Values, ParserError> {
|
||||
let values = self.parse_comma_separated(|parser| {
|
||||
let mut explicit_row = false;
|
||||
|
||||
let rows = self.parse_comma_separated(|parser| {
|
||||
if parser.parse_keyword(Keyword::ROW) {
|
||||
explicit_row = true;
|
||||
}
|
||||
|
||||
parser.expect_token(&Token::LParen)?;
|
||||
let exprs = parser.parse_comma_separated(Parser::parse_expr)?;
|
||||
parser.expect_token(&Token::RParen)?;
|
||||
Ok(exprs)
|
||||
})?;
|
||||
Ok(Values(values))
|
||||
Ok(Values { explicit_row, rows })
|
||||
}
|
||||
|
||||
pub fn parse_start_transaction(&mut self) -> Result<Statement, ParserError> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue