From 90017d3dd188e5b086dbe20d3b79b2e6d129b841 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Mon, 18 May 2026 20:23:17 +0800 Subject: [PATCH] fix(docs): keep deploy config scoped --- crates/dbx-core/src/db/mysql.rs | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rs index e2e6808e7..6d7c402f4 100644 --- a/crates/dbx-core/src/db/mysql.rs +++ b/crates/dbx-core/src/db/mysql.rs @@ -318,7 +318,7 @@ pub async fn execute_query(pool: &MySqlPool, sql: &str, bare: bool) -> Result = vec![]; let mut column_types: Vec = vec![]; @@ -408,23 +408,6 @@ fn is_result_set_query(sql: &str) -> bool { starts_with_executable_sql_keyword(sql, &["SELECT", "SHOW", "DESCRIBE", "EXPLAIN", "WITH"]) } -fn requires_text_protocol_query(sql: &str) -> bool { - if !starts_with_executable_sql_keyword(sql, &["SHOW"]) { - return false; - } - - let tokens = - sql.trim().trim_end_matches(';').split_whitespace().map(|token| token.to_ascii_lowercase()).collect::>(); - - matches!( - tokens.iter().map(String::as_str).collect::>().as_slice(), - ["show", "processlist"] - | ["show", "full", "processlist"] - | ["show", "slave", "status"] - | ["show", "replica", "status"] - ) -} - pub async fn list_indexes(pool: &MySqlPool, database: &str, table: &str) -> Result, String> { let sql = format!( "SELECT INDEX_NAME, GROUP_CONCAT(COLUMN_NAME ORDER BY SEQ_IN_INDEX) AS columns, \ @@ -533,14 +516,4 @@ mod tests { assert!(sql.contains("'PROCEDURE'")); assert!(sql.contains("'FUNCTION'")); } - - #[test] - fn mysql_management_show_queries_use_text_protocol() { - assert!(requires_text_protocol_query("SHOW PROCESSLIST")); - assert!(requires_text_protocol_query("show full processlist")); - assert!(requires_text_protocol_query("SHOW SLAVE STATUS")); - assert!(requires_text_protocol_query("show replica status")); - assert!(!requires_text_protocol_query("SHOW TABLES")); - assert!(!requires_text_protocol_query("SELECT * FROM users")); - } }