mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
fix(postgres): use checked decrement on pending_ready_for_query_count
This commit is contained in:
parent
823261aefc
commit
9e3ece49d7
1 changed files with 5 additions and 1 deletions
|
@ -102,7 +102,11 @@ impl PgConnection {
|
|||
|
||||
#[inline(always)]
|
||||
fn handle_ready_for_query(&mut self, message: ReceivedMessage) -> Result<(), Error> {
|
||||
self.pending_ready_for_query_count -= 1;
|
||||
self.pending_ready_for_query_count = self
|
||||
.pending_ready_for_query_count
|
||||
.checked_sub(1)
|
||||
.ok_or_else(|| err_protocol!("received more ReadyForQuery messages than expected"))?;
|
||||
|
||||
self.transaction_status = message.decode::<ReadyForQuery>()?.transaction_status;
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in a new issue