From a4b1d40315790d89584861ea30571195fe746d7a Mon Sep 17 00:00:00 2001 From: Charles0429 Date: Wed, 17 Jul 2024 10:47:08 +0000 Subject: [PATCH] add mock system view --- .../ob_inner_table_schema.21601_21650.cpp | 180 ++++++++++++++++++ src/share/inner_table/ob_inner_table_schema.h | 18 +- .../ob_inner_table_schema_constants.h | 6 + .../inner_table/ob_inner_table_schema_def.py | 71 +++++++ src/share/inner_table/table_id_to_name | 3 + .../r/mysql/information_schema.result | 6 + .../r/mysql/desc_sys_views_in_mysql.result | 27 +++ .../r/mysql/desc_sys_views_in_sys.result | 27 +++ .../r/mysql/inner_table_overall.result | 3 + 9 files changed, 338 insertions(+), 3 deletions(-) create mode 100644 src/share/inner_table/ob_inner_table_schema.21601_21650.cpp diff --git a/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp b/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp new file mode 100644 index 0000000000..39deefdd43 --- /dev/null +++ b/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp @@ -0,0 +1,180 @@ +/** + * Copyright (c) 2021 OceanBase + * OceanBase CE is licensed under Mulan PubL v2. + * You can use this software according to the terms and conditions of the Mulan PubL v2. + * You may obtain a copy of Mulan PubL v2 at: + * http://license.coscl.org.cn/MulanPubL-2.0 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PubL v2 for more details. + */ + +#define USING_LOG_PREFIX SHARE_SCHEMA +#include "ob_inner_table_schema.h" + +#include "share/schema/ob_schema_macro_define.h" +#include "share/schema/ob_schema_service_sql_impl.h" +#include "share/schema/ob_table_schema.h" +#include "share/scn.h" + +namespace oceanbase +{ +using namespace share::schema; +using namespace common; +namespace share +{ + +int ObInnerTableSchema::innodb_sys_fields_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_SYS_FIELDS_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_SYS_FIELDS_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT CAST(NULL as UNSIGNED) as INDEX_ID, CAST(NULL as CHAR) as NAME, CAST(NULL as UNSIGNED) as POS FROM DUAL WHERE 0 = 1 )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::innodb_sys_foreign_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_SYS_FOREIGN_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_SYS_FOREIGN_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT CAST(NULL as CHAR) as ID, CAST(NULL as CHAR) as FOR_NAME, CAST(NULL as CHAR) as REF_NAME, CAST(NULL as UNSIGNED) as N_COLS, CAST(NULL as UNSIGNED) as TYPE FROM DUAL WHERE 0 = 1 )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + +int ObInnerTableSchema::innodb_sys_foreign_cols_schema(ObTableSchema &table_schema) +{ + int ret = OB_SUCCESS; + uint64_t column_id = OB_APP_MIN_COLUMN_ID - 1; + + //generated fields: + table_schema.set_tenant_id(OB_SYS_TENANT_ID); + table_schema.set_tablegroup_id(OB_INVALID_ID); + table_schema.set_database_id(OB_INFORMATION_SCHEMA_ID); + table_schema.set_table_id(OB_INNODB_SYS_FOREIGN_COLS_TID); + table_schema.set_rowkey_split_pos(0); + table_schema.set_is_use_bloomfilter(false); + table_schema.set_progressive_merge_num(0); + table_schema.set_rowkey_column_num(0); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(SYSTEM_VIEW); + table_schema.set_index_type(INDEX_TYPE_IS_NOT); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_INNODB_SYS_FOREIGN_COLS_TNAME))) { + LOG_ERROR("fail to set table_name", K(ret)); + } + } + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_compress_func_name(OB_DEFAULT_COMPRESS_FUNC_NAME))) { + LOG_ERROR("fail to set compress_func_name", K(ret)); + } + } + table_schema.set_part_level(PARTITION_LEVEL_ZERO); + table_schema.set_charset_type(ObCharset::get_default_charset()); + table_schema.set_collation_type(ObCharset::get_default_collation(ObCharset::get_default_charset())); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_view_definition(R"__( SELECT CAST(NULL as CHAR) as ID, CAST(NULL as CHAR) as FOR_COL_NAME, CAST(NULL as CHAR) as REF_COL_NAME, CAST(NULL as UNSIGNED) as POS FROM DUAL WHERE 0 = 1 )__"))) { + LOG_ERROR("fail to set view_definition", K(ret)); + } + } + table_schema.set_index_using_type(USING_BTREE); + table_schema.set_row_store_type(ENCODING_ROW_STORE); + table_schema.set_store_format(OB_STORE_FORMAT_DYNAMIC_MYSQL); + table_schema.set_progressive_merge_round(1); + table_schema.set_storage_format_version(3); + table_schema.set_tablet_id(0); + + table_schema.set_max_used_column_id(column_id); + return ret; +} + + +} // end namespace share +} // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema.h b/src/share/inner_table/ob_inner_table_schema.h index c08ab2c714..e877251ec8 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -1756,6 +1756,9 @@ public: static int gv_ob_nic_info_schema(share::schema::ObTableSchema &table_schema); static int dba_scheduler_job_run_details_schema(share::schema::ObTableSchema &table_schema); static int cdb_scheduler_job_run_details_schema(share::schema::ObTableSchema &table_schema); + static int innodb_sys_fields_schema(share::schema::ObTableSchema &table_schema); + static int innodb_sys_foreign_schema(share::schema::ObTableSchema &table_schema); + static int innodb_sys_foreign_cols_schema(share::schema::ObTableSchema &table_schema); static int dba_synonyms_schema(share::schema::ObTableSchema &table_schema); static int dba_objects_ora_schema(share::schema::ObTableSchema &table_schema); static int all_objects_schema(share::schema::ObTableSchema &table_schema); @@ -4600,6 +4603,9 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::gv_ob_nic_info_schema, ObInnerTableSchema::dba_scheduler_job_run_details_schema, ObInnerTableSchema::cdb_scheduler_job_run_details_schema, + ObInnerTableSchema::innodb_sys_fields_schema, + ObInnerTableSchema::innodb_sys_foreign_schema, + ObInnerTableSchema::innodb_sys_foreign_cols_schema, ObInnerTableSchema::dba_synonyms_schema, ObInnerTableSchema::dba_objects_ora_schema, ObInnerTableSchema::all_objects_schema, @@ -6296,6 +6302,9 @@ const uint64_t tenant_space_tables [] = { OB_V_OB_NIC_INFO_TID, OB_GV_OB_NIC_INFO_TID, OB_DBA_SCHEDULER_JOB_RUN_DETAILS_TID, + OB_INNODB_SYS_FIELDS_TID, + OB_INNODB_SYS_FOREIGN_TID, + OB_INNODB_SYS_FOREIGN_COLS_TID, OB_DBA_SYNONYMS_TID, OB_DBA_OBJECTS_ORA_TID, OB_ALL_OBJECTS_TID, @@ -8903,6 +8912,9 @@ const char* const tenant_space_table_names [] = { OB_V_OB_NIC_INFO_TNAME, OB_GV_OB_NIC_INFO_TNAME, OB_DBA_SCHEDULER_JOB_RUN_DETAILS_TNAME, + OB_INNODB_SYS_FIELDS_TNAME, + OB_INNODB_SYS_FOREIGN_TNAME, + OB_INNODB_SYS_FOREIGN_COLS_TNAME, OB_DBA_SYNONYMS_TNAME, OB_DBA_OBJECTS_ORA_TNAME, OB_ALL_OBJECTS_TNAME, @@ -13034,10 +13046,10 @@ static inline int get_sys_table_lob_aux_schema(const uint64_t tid, const int64_t OB_CORE_TABLE_COUNT = 4; const int64_t OB_SYS_TABLE_COUNT = 296; const int64_t OB_VIRTUAL_TABLE_COUNT = 821; -const int64_t OB_SYS_VIEW_COUNT = 901; -const int64_t OB_SYS_TENANT_TABLE_COUNT = 2023; +const int64_t OB_SYS_VIEW_COUNT = 904; +const int64_t OB_SYS_TENANT_TABLE_COUNT = 2026; const int64_t OB_CORE_SCHEMA_VERSION = 1; -const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2026; +const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2029; } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema_constants.h b/src/share/inner_table/ob_inner_table_schema_constants.h index eb952c8f8a..e8209e72aa 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -1492,6 +1492,9 @@ const uint64_t OB_V_OB_NIC_INFO_TID = 21581; // "V$OB_NIC_INFO" const uint64_t OB_GV_OB_NIC_INFO_TID = 21586; // "GV$OB_NIC_INFO" const uint64_t OB_DBA_SCHEDULER_JOB_RUN_DETAILS_TID = 21589; // "DBA_SCHEDULER_JOB_RUN_DETAILS" const uint64_t OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TID = 21590; // "CDB_SCHEDULER_JOB_RUN_DETAILS" +const uint64_t OB_INNODB_SYS_FIELDS_TID = 21603; // "INNODB_SYS_FIELDS" +const uint64_t OB_INNODB_SYS_FOREIGN_TID = 21604; // "INNODB_SYS_FOREIGN" +const uint64_t OB_INNODB_SYS_FOREIGN_COLS_TID = 21605; // "INNODB_SYS_FOREIGN_COLS" const uint64_t OB_DBA_SYNONYMS_TID = 25001; // "DBA_SYNONYMS" const uint64_t OB_DBA_OBJECTS_ORA_TID = 25002; // "DBA_OBJECTS_ORA" const uint64_t OB_ALL_OBJECTS_TID = 25003; // "ALL_OBJECTS" @@ -4223,6 +4226,9 @@ const char *const OB_V_OB_NIC_INFO_TNAME = "V$OB_NIC_INFO"; const char *const OB_GV_OB_NIC_INFO_TNAME = "GV$OB_NIC_INFO"; const char *const OB_DBA_SCHEDULER_JOB_RUN_DETAILS_TNAME = "DBA_SCHEDULER_JOB_RUN_DETAILS"; const char *const OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TNAME = "CDB_SCHEDULER_JOB_RUN_DETAILS"; +const char *const OB_INNODB_SYS_FIELDS_TNAME = "INNODB_SYS_FIELDS"; +const char *const OB_INNODB_SYS_FOREIGN_TNAME = "INNODB_SYS_FOREIGN"; +const char *const OB_INNODB_SYS_FOREIGN_COLS_TNAME = "INNODB_SYS_FOREIGN_COLS"; const char *const OB_DBA_SYNONYMS_TNAME = "DBA_SYNONYMS"; const char *const OB_DBA_OBJECTS_ORA_TNAME = "DBA_OBJECTS"; const char *const OB_ALL_OBJECTS_TNAME = "ALL_OBJECTS"; diff --git a/src/share/inner_table/ob_inner_table_schema_def.py b/src/share/inner_table/ob_inner_table_schema_def.py index d296d9b60f..77780d4929 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -35353,6 +35353,77 @@ SELECT # 21601: GV$OB_KV_GROUP_COMMIT_STATUS # 21602: V$OB_KV_GROUP_COMMIT_STATUS +def_table_schema( + owner = 'zhenjiang.xzj', + tablegroup_id = 'OB_INVALID_ID', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_SYS_FIELDS', + table_id = '21603', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + CAST(NULL as UNSIGNED) as INDEX_ID, + CAST(NULL as CHAR) as NAME, + CAST(NULL as UNSIGNED) as POS + FROM + DUAL + WHERE + 0 = 1 +""".replace("\n", " ") +) + +def_table_schema( + owner = 'zhenjiang.xzj', + tablegroup_id = 'OB_INVALID_ID', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_SYS_FOREIGN', + table_id = '21604', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + CAST(NULL as CHAR) as ID, + CAST(NULL as CHAR) as FOR_NAME, + CAST(NULL as CHAR) as REF_NAME, + CAST(NULL as UNSIGNED) as N_COLS, + CAST(NULL as UNSIGNED) as TYPE + FROM + DUAL + WHERE + 0 = 1 +""".replace("\n", " ") +) + +def_table_schema( + owner = 'zhenjiang.xzj', + tablegroup_id = 'OB_INVALID_ID', + database_id = 'OB_INFORMATION_SCHEMA_ID', + table_name = 'INNODB_SYS_FOREIGN_COLS', + table_id = '21605', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """ + SELECT + CAST(NULL as CHAR) as ID, + CAST(NULL as CHAR) as FOR_COL_NAME, + CAST(NULL as CHAR) as REF_COL_NAME, + CAST(NULL as UNSIGNED) as POS + FROM + DUAL + WHERE + 0 = 1 +""".replace("\n", " ") +) # 余留位置(此行之前占位) # 本区域占位建议:采用真实视图名进行占位 diff --git a/src/share/inner_table/table_id_to_name b/src/share/inner_table/table_id_to_name index 99a6dd3ec4..0331e6b942 100644 --- a/src/share/inner_table/table_id_to_name +++ b/src/share/inner_table/table_id_to_name @@ -2165,6 +2165,9 @@ # 21586: GV$OB_NIC_INFO # 21589: DBA_SCHEDULER_JOB_RUN_DETAILS # 21590: CDB_SCHEDULER_JOB_RUN_DETAILS +# 21603: INNODB_SYS_FIELDS +# 21604: INNODB_SYS_FOREIGN +# 21605: INNODB_SYS_FOREIGN_COLS # 25001: DBA_SYNONYMS # 25002: DBA_OBJECTS # 25003: ALL_OBJECTS diff --git a/tools/deploy/mysql_test/r/mysql/information_schema.result b/tools/deploy/mysql_test/r/mysql/information_schema.result index 8b7078cbe1..c2fd2a1f4a 100644 --- a/tools/deploy/mysql_test/r/mysql/information_schema.result +++ b/tools/deploy/mysql_test/r/mysql/information_schema.result @@ -209,6 +209,9 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_CMP_RESET | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_METRICS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_DATAFILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FIELDS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FOREIGN | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FOREIGN_COLS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_INDEXES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_TABLES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_TABLESPACES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -1705,6 +1708,9 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | information_schema | INNODB_CMP_RESET | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_METRICS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_DATAFILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FIELDS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FOREIGN | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | information_schema | INNODB_SYS_FOREIGN_COLS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_INDEXES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_TABLES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | information_schema | INNODB_SYS_TABLESPACES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result index 36771012e7..8e8db44d78 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_mysql.result @@ -6579,6 +6579,33 @@ GMT_MODIFIED timestamp(6) YES select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.DBA_SCHEDULER_JOB_RUN_DETAILS limit 1); cnt 1 +desc information_schema.INNODB_SYS_FIELDS; +Field Type Null Key Default Extra +INDEX_ID bigint(0) unsigned NO +NAME varchar(0) NO +POS bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FIELDS limit 1); +cnt +1 +desc information_schema.INNODB_SYS_FOREIGN; +Field Type Null Key Default Extra +ID varchar(0) NO +FOR_NAME varchar(0) NO +REF_NAME varchar(0) NO +N_COLS bigint(0) unsigned NO +TYPE bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN limit 1); +cnt +1 +desc information_schema.INNODB_SYS_FOREIGN_COLS; +Field Type Null Key Default Extra +ID varchar(0) NO +FOR_COL_NAME varchar(0) NO +REF_COL_NAME varchar(0) NO +POS bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN_COLS limit 1); +cnt +1 select case cnt when 0 then NULL else 'UNEXPECTED ERROR: It is expected to be an empty set, which means that all GV$ and V$ view column names are defined consistently' end ERROR_INFO from (select /*+no_rewrite*/ count(*) cnt from (SELECT t.table_name, group_concat(c.column_name) as column_name_list diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result index 5fea14d952..24e267e1a9 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_sys_views_in_sys.result @@ -9363,6 +9363,33 @@ GMT_MODIFIED timestamp(6) NO NULL select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.CDB_SCHEDULER_JOB_RUN_DETAILS limit 1); cnt 1 +desc information_schema.INNODB_SYS_FIELDS; +Field Type Null Key Default Extra +INDEX_ID bigint(0) unsigned NO +NAME varchar(0) NO +POS bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FIELDS limit 1); +cnt +1 +desc information_schema.INNODB_SYS_FOREIGN; +Field Type Null Key Default Extra +ID varchar(0) NO +FOR_NAME varchar(0) NO +REF_NAME varchar(0) NO +N_COLS bigint(0) unsigned NO +TYPE bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN limit 1); +cnt +1 +desc information_schema.INNODB_SYS_FOREIGN_COLS; +Field Type Null Key Default Extra +ID varchar(0) NO +FOR_COL_NAME varchar(0) NO +REF_COL_NAME varchar(0) NO +POS bigint(0) unsigned NO +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from information_schema.INNODB_SYS_FOREIGN_COLS limit 1); +cnt +1 select case cnt when 0 then NULL else 'UNEXPECTED ERROR: It is expected to be an empty set, which means that all GV$ and V$ view column names are defined consistently' end ERROR_INFO from (select /*+no_rewrite*/ count(*) cnt from (SELECT t.table_name, group_concat(c.column_name) as column_name_list diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result index 59dd0e0101..64a7007887 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/inner_table_overall.result @@ -1191,6 +1191,9 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 21586 GV$OB_NIC_INFO 1 201001 1 21589 DBA_SCHEDULER_JOB_RUN_DETAILS 1 201001 1 21590 CDB_SCHEDULER_JOB_RUN_DETAILS 1 201001 1 +21603 INNODB_SYS_FIELDS 1 201002 1 +21604 INNODB_SYS_FOREIGN 1 201002 1 +21605 INNODB_SYS_FOREIGN_COLS 1 201002 1 check sys table count and table_id range success check count and table_id range for virtual table success select * from information_schema.CHARACTER_SETS limit 1;