Fix displaying WORK or TRANSACTION after BEGIN (#1565)

This commit is contained in:
Michael Victor Zink 2024-12-03 17:10:28 -08:00 committed by GitHub
parent 6517da6b7d
commit c761f0babb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 44 additions and 10 deletions

View file

@ -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,
})
}