diff --git a/crates/dbx-core/src/schema.rs b/crates/dbx-core/src/schema.rs index e18134991a..f46e234153 100644 --- a/crates/dbx-core/src/schema.rs +++ b/crates/dbx-core/src/schema.rs @@ -3465,7 +3465,12 @@ mod ddl_tests { pub async fn mysql_ddl(pool: &db::mysql::MySqlPool, table: &str) -> Result { use mysql_async::prelude::*; let sql = format!("SHOW CREATE TABLE `{}`", table.replace('`', "``")); - let mut conn = pool.get_conn().await.map_err(|e| e.to_string())?; + // Use the health-checked getter so a stale pooled connection (server closed + // it after an idle timeout, NAT/firewall dropped the TCP state, etc.) is + // detected and replaced before issuing the query. Without this, the first + // DDL request after a period of inactivity could surface a low-level + // connection error that a manual refresh would have masked. + let mut conn = db::mysql::get_conn_with_health_check(pool).await?; let result = conn.query_iter(&sql).await.map_err(|e| e.to_string())?; let rows: Vec = result.collect_and_drop().await.map_err(|e| e.to_string())?; let row = rows.first().ok_or("DDL not found")?; diff --git a/crates/dbx-web/src/routes/connection.rs b/crates/dbx-web/src/routes/connection.rs index 9335837f15..5a3a8c80a9 100644 --- a/crates/dbx-web/src/routes/connection.rs +++ b/crates/dbx-web/src/routes/connection.rs @@ -286,6 +286,7 @@ mod tests { redis_sentinel_tls: false, redis_cluster_nodes: String::new(), redis_key_separator: dbx_core::models::connection::default_redis_key_separator(), + redis_scan_page_size: None, etcd_endpoints: String::new(), gbase_server: String::new(), informix_server: String::new(), diff --git a/src-tauri/src/commands/connection.rs b/src-tauri/src/commands/connection.rs index ec21b7813c..6e705af38b 100644 --- a/src-tauri/src/commands/connection.rs +++ b/src-tauri/src/commands/connection.rs @@ -248,6 +248,7 @@ mod tests { redis_sentinel_tls: false, redis_cluster_nodes: String::new(), redis_key_separator: dbx_core::models::connection::default_redis_key_separator(), + redis_scan_page_size: None, etcd_endpoints: String::new(), gbase_server: String::new(), informix_server: String::new(),