From bcb324b36a126132dab0005ad537ffbebc773223 Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 16 Mar 2023 18:38:46 +0800 Subject: [PATCH] feat(meta): add internal table to pg_class (#8594) --- .../src/catalog/system_catalog/pg_catalog/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/frontend/src/catalog/system_catalog/pg_catalog/mod.rs b/src/frontend/src/catalog/system_catalog/pg_catalog/mod.rs index cc16b50ec2c9..75086c5d2dfc 100644 --- a/src/frontend/src/catalog/system_catalog/pg_catalog/mod.rs +++ b/src/frontend/src/catalog/system_catalog/pg_catalog/mod.rs @@ -397,12 +397,28 @@ impl SysCatalogReaderImpl { }) .collect_vec(); + let internal_tables = schema + .iter_internal_table() + .map(|table| { + OwnedRow::new(vec![ + Some(ScalarImpl::Int32(table.id.table_id() as i32)), + Some(ScalarImpl::Utf8(table.name.clone().into())), + Some(ScalarImpl::Int32(schema_info.id as i32)), + Some(ScalarImpl::Int32(table.owner as i32)), + Some(ScalarImpl::Utf8("n".into())), + Some(ScalarImpl::Int32(0)), + Some(ScalarImpl::Int32(0)), + ]) + }) + .collect_vec(); + rows.into_iter() .chain(mvs.into_iter()) .chain(indexes.into_iter()) .chain(sources.into_iter()) .chain(sys_tables.into_iter()) .chain(views.into_iter()) + .chain(internal_tables.into_iter()) .collect_vec() }) .collect_vec())