Fix:同步 OceanBase 查询超时设置 (#2156)
This commit is contained in:
3 files changed
+179
-35
No files matched your search
@@ -34,6 +34,33 @@ async fn live_mysql_compatible_limited_text_protocol_query_succeeds() {
|
||||
assert!(result.rows.len() <= 100);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a remote OceanBase MySQL-compatible endpoint"]
|
||||
async fn live_oceanbase_mysql_setup_applies_query_timeout() {
|
||||
let url = std::env::var("DBX_LIVE_OCEANBASE_MYSQL_URL").expect("DBX_LIVE_OCEANBASE_MYSQL_URL");
|
||||
let setup = vec!["SET ob_query_timeout = 30000000".to_string()];
|
||||
|
||||
let pool = dbx_core::db::mysql::connect_bare_with_pool_limit_and_setup(
|
||||
&url,
|
||||
std::time::Duration::from_secs(10),
|
||||
1,
|
||||
&setup,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let result = dbx_core::db::mysql::execute_query_with_max_rows(
|
||||
&pool,
|
||||
"SELECT @@ob_query_timeout",
|
||||
true,
|
||||
Some(10),
|
||||
Default::default(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(result.rows, vec![vec![serde_json::json!("30000000")]]);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
#[ignore = "requires a remote MySQL endpoint"]
|
||||
async fn live_mysql_query_cancel_kills_running_sleep() {
|
||||
|
||||
Reference in new issue
Block a user