From 63ef26b25aa0e3e89f7d8345eadc83640c5adee3 Mon Sep 17 00:00:00 2001 From: zipg Date: Thu, 9 Jul 2026 22:21:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=20MySQL=20=E4=BB=A3?= =?UTF-8?q?=E7=90=86=20packet=20out=20of=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: zipg <4047349+zipg@users.noreply.github.com> --- crates/dbx-core/src/db/mysql.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs index 36990571f..48c4efed7 100644 --- a/crates/dbx-core/src/db/mysql.rs +++ b/crates/dbx-core/src/db/mysql.rs @@ -1068,6 +1068,9 @@ fn mysql_error_should_retry_without_ssl(error: &str) -> bool { || error.contains("handshake") || error.contains("tls connection") || error.contains("server closed session") + // Some older MySQL proxies report a failed preferred-TLS probe as a + // protocol packet error instead of a TLS handshake error. + || error.contains("packet out of order") // Some MySQL-compatible servers report a preferred-TLS attempt as a // normal server error instead of a TLS handshake error. || (error.contains("client asked for ssl") && error.contains("server does not have this capability")) @@ -4206,6 +4209,13 @@ UNIQUE KEY(`tenant_id`, `name``part`) assert!(mysql_error_should_retry_without_ssl(error)); } + #[test] + fn mysql_packet_out_of_order_can_retry_without_ssl() { + let error = "MySQL connection failed: Input/output error: Input/output error: packet out of order"; + + assert!(mysql_error_should_retry_without_ssl(error)); + } + #[test] fn mysql_tcp_keepalive_uses_milliseconds_not_seconds() { assert_eq!(MYSQL_TCP_KEEPALIVE_MS, 30_000);