diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs index 36990571f6..48c4efed7e 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);