fix(mysql): skip cleanup rollback when no transaction is open

This commit is contained in:
t8y2 committed 2026-09-24 00:32:25 +08:00
1 parent 372d060d37
commit 0724754c85
2 files changed
+89 -11

No files matched your search

+8
View File
@@ -188,6 +188,14 @@ pub fn session_status_from_last_ok(conn: &mysql_async::Conn) -> Option<MySqlSess
})
}
/// Whether the last OK/EOF packet ended the server's whole response. A packet
/// with `SERVER_MORE_RESULTS_EXISTS` only closed one result set of a response
/// that is still pending (a `CALL` returning several sets), so its status
/// flags may not describe the session once the response finishes.
pub fn last_ok_ends_response(conn: &mysql_async::Conn) -> bool {
conn.last_ok_packet().is_some_and(|packet| !packet.status_flags().contains(StatusFlags::SERVER_MORE_RESULTS_EXISTS))
}
const MYSQL_TCP_KEEPALIVE_MS: u32 = 30_000;
const MYSQL_SQL_PACKET_MARGIN_MAX_BYTES: usize = 64 * 1024;