Skip to content

Commit 86f9972

Browse files
authored
fix(query): ignore system tables in admin tables api (#17931)
* fix: ignore system tables in admin tables api * z * z
1 parent 5f01cb3 commit 86f9972

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

.github/workflows/cloud.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ jobs:
9898
with:
9999
repo: databend-query
100100
ecr_role_arn: ${{ secrets.ECR_ROLE_ARN }}
101+
dockerhub_user: ${{ secrets.DOCKERHUB_USERNAME }}
102+
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
101103
- name: Prepare for docker
102104
id: prepare
103105
run: |

src/query/service/src/servers/admin/v1/tenant_table_stats.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,10 @@ async fn load_tenant_tables_stats(tenant: &Tenant) -> Result<TenantTablesStatsRe
6868
let mut external_stats: BTreeMap<String, TenantTableStatsInfo> = BTreeMap::new();
6969
let mut warnings: Vec<String> = vec![];
7070

71+
let system_dbs = ["information_schema", "system"];
7172
for database in databases {
7273
let db_name = database.name().to_lowercase();
73-
if db_name == "information_schema" || db_name == "system" {
74+
if system_dbs.contains(&db_name.as_str()) {
7475
continue;
7576
}
7677
database_count += 1;

src/query/service/src/servers/admin/v1/tenant_tables.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,12 @@ async fn load_tenant_tables(tenant: &Tenant) -> Result<TenantTablesResponse> {
7171
hide_options_in_show_create_table: false,
7272
};
7373

74+
let system_dbs = ["information_schema", "system"];
7475
for database in databases {
76+
let db_name = database.name().to_lowercase();
77+
if system_dbs.contains(&db_name.as_str()) {
78+
continue;
79+
}
7580
let database_info = database.get_db_info();
7681
let tables = match catalog.list_tables(tenant, database.name()).await {
7782
Ok(v) => v,

0 commit comments

Comments
 (0)