refactor: cleanup tests about procedure tenant tables
@@ -414,61 +414,3 @@ async fn test_call_tenant_quota_interpreter() -> Result<()> {
Ok(())
}
-
-#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
-async fn test_call_stats_tenant_tables_interpreter() -> Result<()> {
- let ctx = crate::tests::create_query_context().await?;
- let mut planner = Planner::new(ctx.clone());
-
- // NumberArgumentsNotMatch
- {
- let query = "call stats$tenant_tables()";
- let (plan, _, _) = planner.plan_sql(query).await?;
- let executor = InterpreterFactoryV2::get(ctx.clone(), &plan)?;
- assert_eq!(executor.name(), "CallInterpreter");
- let res = executor.execute().await;
- assert_eq!(res.is_err(), true);
- let expect = "Code: 1028, displayText = Function `TENANT_TABLES` expect to have [1, 18446744073709551614] arguments, but got 0.";
- assert_eq!(expect, res.err().unwrap().to_string());
- }
-
- // Access denied
- {
- let query = "call stats$tenant_tables(tenant1)";
- let (plan, _, _) = planner.plan_sql(query).await?;
- let executor = InterpreterFactoryV2::get(ctx.clone(), &plan)?;
- let res = executor.execute().await;
- assert_eq!(res.is_err(), true);
- let expect = "Code: 1062, displayText = Access denied: 'TENANT_TABLES' only used in management-mode.";
- assert_eq!(expect, res.err().unwrap().to_string());
- }
-
- let conf = crate::tests::ConfigBuilder::create()
- .with_management_mode()
- .config();
- let mut user_info = ctx.get_current_user()?;
- user_info
- .option
- .set_option_flag(UserOptionFlag::TenantSetting);
- let ctx = crate::tests::create_query_context_with_config(conf.clone(), Some(user_info)).await?;
-
- {
- let query = "call stats$tenant_tables(tenant1, tenant2, tenant3)";
- let (plan, _, _) = planner.plan_sql(query).await?;
- let executor = InterpreterFactoryV2::get(ctx.clone(), &plan)?;
- let stream = executor.execute().await?;
- let result = stream.try_collect::<Vec<_>>().await?;
- let expected = vec![
- "+-----------+-------------+",
- "| tenant_id | table_count |",
- "+-----------+-------------+",
- "| tenant1 | 0 |",
- "| tenant2 | 0 |",
- "| tenant3 | 0 |",
- "+-----------+-------------+",
- ];
- common_datablocks::assert_blocks_sorted_eq(expected, result.as_slice());
- }
-
- Ok(())
-}
