From 7a4987f230a739df24c81b43d7903d8472da5e86 Mon Sep 17 00:00:00 2001 From: Duncan Fairbanks Date: Tue, 3 Dec 2024 14:05:13 -0800 Subject: [PATCH] fix: cache Status on MySqlConnection --- sqlx-mysql/src/connection/executor.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlx-mysql/src/connection/executor.rs b/sqlx-mysql/src/connection/executor.rs index 07c7979b08..169dee76b7 100644 --- a/sqlx-mysql/src/connection/executor.rs +++ b/sqlx-mysql/src/connection/executor.rs @@ -166,6 +166,8 @@ impl MySqlConnection { // this indicates either a successful query with no rows at all or a failed query let ok = packet.ok()?; + self.inner.status_flags = ok.status; + let rows_affected = ok.affected_rows; logger.increase_rows_affected(rows_affected); let done = MySqlQueryResult { @@ -208,6 +210,8 @@ impl MySqlConnection { if packet[0] == 0xfe && packet.len() < 9 { let eof = packet.eof(self.inner.stream.capabilities)?; + self.inner.status_flags = eof.status; + r#yield!(Either::Left(MySqlQueryResult { rows_affected: 0, last_insert_id: 0,