mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-12-23 11:12:51 +00:00
Fix displaying WORK or TRANSACTION after BEGIN (#1565)
This commit is contained in:
parent
6517da6b7d
commit
c761f0babb
5 changed files with 44 additions and 10 deletions
|
|
@ -12123,6 +12123,7 @@ impl<'a> Parser<'a> {
|
|||
Ok(Statement::StartTransaction {
|
||||
modes: self.parse_transaction_modes()?,
|
||||
begin: false,
|
||||
transaction: Some(BeginTransactionKind::Transaction),
|
||||
modifier: None,
|
||||
})
|
||||
}
|
||||
|
|
@ -12139,10 +12140,15 @@ impl<'a> Parser<'a> {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
let _ = self.parse_one_of_keywords(&[Keyword::TRANSACTION, Keyword::WORK]);
|
||||
let transaction = match self.parse_one_of_keywords(&[Keyword::TRANSACTION, Keyword::WORK]) {
|
||||
Some(Keyword::TRANSACTION) => Some(BeginTransactionKind::Transaction),
|
||||
Some(Keyword::WORK) => Some(BeginTransactionKind::Work),
|
||||
_ => None,
|
||||
};
|
||||
Ok(Statement::StartTransaction {
|
||||
modes: self.parse_transaction_modes()?,
|
||||
begin: true,
|
||||
transaction,
|
||||
modifier,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue