Skip to content

Commit

Permalink
fix: cache Status on MySqlConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
bonsairobo committed Dec 3, 2024
1 parent 9756385 commit 7a4987f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqlx-mysql/src/connection/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 7a4987f

Please sign in to comment.