fix: disable prefer_socket in mysql_async to fix StarRocks connection after upgrade
Newer StarRocks versions reject the @@socket system variable that mysql_async queries during connection initialization when prefer_socket is enabled (default on non-Windows). Since we always use TCP connections, Unix socket detection is unnecessary.
This commit is contained in:
parent
4fa363b1a9
commit
d973fb78c1
|
|
@ -188,7 +188,8 @@ fn create_pool(url: &str) -> Result<MySqlPool, String> {
|
|||
let pool_opts = mysql_async::PoolOpts::new()
|
||||
.with_constraints(mysql_async::PoolConstraints::new(1, 5).unwrap())
|
||||
.with_inactive_connection_ttl(Duration::from_secs(300));
|
||||
let builder = mysql_async::OptsBuilder::from_opts(opts).stmt_cache_size(0).pool_opts(Some(pool_opts));
|
||||
let builder =
|
||||
mysql_async::OptsBuilder::from_opts(opts).stmt_cache_size(0).prefer_socket(false).pool_opts(Some(pool_opts));
|
||||
Ok(MySqlPool::new(builder))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue