fix(connection): use bare mysql options for oceanbase
This commit is contained in:
1 parent
12500c0b2a
commit
339081af35
1 file changed
+10
-1
@@ -171,7 +171,7 @@ impl ConnectionConfig {
|
|||||||
.driver_profile
|
.driver_profile
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.map(|p| p.to_lowercase())
|
.map(|p| p.to_lowercase())
|
||||||
.is_some_and(|p| matches!(p.as_str(), "doris" | "starrocks" | "selectdb" | "tdengine"))
|
.is_some_and(|p| matches!(p.as_str(), "doris" | "starrocks" | "selectdb" | "tdengine" | "oceanbase"))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn connection_url(&self) -> String {
|
pub fn connection_url(&self) -> String {
|
||||||
@@ -634,6 +634,15 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn oceanbase_profile_uses_bare_mysql_connection_options() {
|
||||||
|
let mut config = mysql_config("user@tenant#cluster", "secret", None);
|
||||||
|
config.driver_profile = Some("oceanbase".to_string());
|
||||||
|
|
||||||
|
assert!(config.needs_bare_mysql());
|
||||||
|
assert_eq!(config.connection_url(), "mysql://user%40tenant%23cluster:secret@10.1.2.3:2883?ssl-mode=disabled");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn mysql_url_encodes_password_and_database() {
|
fn mysql_url_encodes_password_and_database() {
|
||||||
let config = mysql_config("root", "p@ss:word#1", Some("db/name"));
|
let config = mysql_config("root", "p@ss:word#1", Some("db/name"));
|
||||||
|
|||||||
Reference in new issue
Block a user