fix(informix): add informix_server field for direct INFORMIXSERVER input
This commit is contained in:
1 parent
48af146b95
commit
1aa48cf636
8 files changed
+37
-2
No files matched your search
@@ -49,6 +49,7 @@ pub fn agent_connect_params(config: &ConnectionConfig, host: &str, port: u16, da
|
||||
"client_key_path": config.client_key_path,
|
||||
"etcd_endpoints": etcd_endpoints,
|
||||
"gbase_server": config.gbase_server,
|
||||
"informix_server": config.informix_server,
|
||||
"jdbc_driver_class": config.jdbc_driver_class.as_deref().unwrap_or(""),
|
||||
"jdbc_driver_paths": &config.jdbc_driver_paths,
|
||||
})
|
||||
@@ -564,6 +565,7 @@ mod tests {
|
||||
redis_key_separator: default_redis_key_separator(),
|
||||
etcd_endpoints: String::new(),
|
||||
gbase_server: String::new(),
|
||||
informix_server: String::new(),
|
||||
external_config: None,
|
||||
jdbc_driver_class: None,
|
||||
jdbc_driver_paths: Vec::new(),
|
||||
|
||||
@@ -808,7 +808,7 @@ fn agent_java_args(jar_path: &str) -> Vec<String> {
|
||||
.map(str::to_string)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if agent_jar_path_matches_key(jar_path, "kingbase") {
|
||||
if agent_jar_path_matches_key(jar_path, "kingbase") || agent_jar_path_matches_key(jar_path, "informix") {
|
||||
args.push("-Djava.net.preferIPv4Stack=true".to_string());
|
||||
}
|
||||
|
||||
@@ -981,6 +981,13 @@ mod tests {
|
||||
assert!(args.iter().any(|arg| arg == "-Djava.net.preferIPv4Stack=true"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agent_java_args_prefer_ipv4_for_informix() {
|
||||
let args = agent_java_args("/tmp/dbx/drivers/informix/agent.jar");
|
||||
|
||||
assert!(args.iter().any(|arg| arg == "-Djava.net.preferIPv4Stack=true"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn agent_java_args_do_not_prefer_ipv4_for_other_agents() {
|
||||
let args = agent_java_args("/tmp/dbx/drivers/highgo/agent.jar");
|
||||
|
||||
@@ -68,6 +68,10 @@ pub struct ConnectionConfig {
|
||||
pub etcd_endpoints: String,
|
||||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
pub gbase_server: String,
|
||||
/// Informix server name (INFORMIXSERVER). When empty, the agent
|
||||
/// derives it from the hostname.
|
||||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
pub informix_server: String,
|
||||
/// Typed configuration for external tabular sources.
|
||||
#[serde(default)]
|
||||
pub external_config: Option<serde_json::Value>,
|
||||
@@ -374,6 +378,8 @@ struct ConnectionConfigData {
|
||||
#[serde(default)]
|
||||
pub gbase_server: String,
|
||||
#[serde(default)]
|
||||
pub informix_server: String,
|
||||
#[serde(default)]
|
||||
pub external_config: Option<serde_json::Value>,
|
||||
#[serde(default)]
|
||||
pub jdbc_driver_class: Option<String>,
|
||||
@@ -424,6 +430,7 @@ impl From<ConnectionConfigData> for ConnectionConfig {
|
||||
redis_key_separator: data.redis_key_separator,
|
||||
etcd_endpoints: data.etcd_endpoints,
|
||||
gbase_server: data.gbase_server,
|
||||
informix_server: data.informix_server,
|
||||
external_config: data.external_config,
|
||||
jdbc_driver_class: data.jdbc_driver_class,
|
||||
jdbc_driver_paths: data.jdbc_driver_paths,
|
||||
@@ -1463,6 +1470,7 @@ mod tests {
|
||||
redis_key_separator: default_redis_key_separator(),
|
||||
etcd_endpoints: String::new(),
|
||||
gbase_server: String::new(),
|
||||
informix_server: String::new(),
|
||||
external_config: None,
|
||||
jdbc_driver_class: None,
|
||||
jdbc_driver_paths: Vec::new(),
|
||||
|
||||
Reference in new issue
Block a user