Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix: 兼容 MySQL 代理 packet out of order

zipg63ef26b25aa0
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);