From 695a8e0b549f57e1d05688b76070f5b099b05ca7 Mon Sep 17 00:00:00 2001 From: lalalafeier Date: Mon, 26 Aug 2024 06:26:38 +0000 Subject: [PATCH] add virtual table| view about tmp file --- src/observer/CMakeLists.txt | 1 + .../virtual_table/ob_all_virtual_tmp_file.cpp | 221 + .../virtual_table/ob_all_virtual_tmp_file.h | 81 + .../ob_virtual_table_iterator_factory.cpp | 13 + .../ob_inner_table_schema.12501_12550.cpp | 402 + .../ob_inner_table_schema.15451_15500.cpp | 369 + .../ob_inner_table_schema.21601_21650.cpp | 100 + .../ob_inner_table_schema.28201_28250.cpp | 19750 --------------- .../ob_inner_table_schema.28251_28300.cpp | 19830 ++++++++++++++++ src/share/inner_table/ob_inner_table_schema.h | 34 +- .../ob_inner_table_schema_constants.h | 10 + .../inner_table/ob_inner_table_schema_def.py | 138 +- src/share/inner_table/table_id_to_name | 6 + .../tmp_file/ob_shared_nothing_tmp_file.cpp | 143 +- .../tmp_file/ob_shared_nothing_tmp_file.h | 91 +- .../tmp_file/ob_tmp_file_block_manager.cpp | 6 +- .../tmp_file/ob_tmp_file_block_manager.h | 1 - src/storage/tmp_file/ob_tmp_file_io_ctx.cpp | 2 + src/storage/tmp_file/ob_tmp_file_io_ctx.h | 3 + src/storage/tmp_file/ob_tmp_file_manager.cpp | 66 +- src/storage/tmp_file/ob_tmp_file_manager.h | 16 + .../r/mysql/information_schema.result | 4 + .../r/mysql/desc_sys_views_in_mysql.result | 20 + .../r/mysql/desc_sys_views_in_sys.result | 41 + .../mysql/desc_virtual_table_in_mysql.result | 29 + .../r/mysql/desc_virtual_table_in_sys.result | 29 + .../r/mysql/inner_table_overall.result | 3 + 27 files changed, 21639 insertions(+), 19770 deletions(-) create mode 100644 src/observer/virtual_table/ob_all_virtual_tmp_file.cpp create mode 100644 src/observer/virtual_table/ob_all_virtual_tmp_file.h create mode 100644 src/share/inner_table/ob_inner_table_schema.12501_12550.cpp create mode 100644 src/share/inner_table/ob_inner_table_schema.28251_28300.cpp diff --git a/src/observer/CMakeLists.txt b/src/observer/CMakeLists.txt index 77d4ff66d..addb3f1b8 100644 --- a/src/observer/CMakeLists.txt +++ b/src/observer/CMakeLists.txt @@ -448,6 +448,7 @@ ob_set_subtarget(ob_server virtual_table virtual_table/ob_all_virtual_tenant_scheduler_running_job.cpp virtual_table/ob_all_virtual_compatibility_control.cpp virtual_table/ob_all_virtual_session_ps_info.cpp + virtual_table/ob_all_virtual_tmp_file.cpp ) ob_server_add_target(ob_server) diff --git a/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp b/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp new file mode 100644 index 000000000..5f2500bb7 --- /dev/null +++ b/src/observer/virtual_table/ob_all_virtual_tmp_file.cpp @@ -0,0 +1,221 @@ +/** + * 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. + */ + +#include "observer/virtual_table/ob_all_virtual_tmp_file.h" +#include "observer/ob_server.h" +#include "storage/tmp_file/ob_shared_nothing_tmp_file.h" + +using namespace oceanbase::common; +using namespace oceanbase::transaction; + +namespace oceanbase +{ +namespace observer +{ + +ObAllVirtualTmpFileInfo::ObAllVirtualTmpFileInfo() + : ObVirtualTableScannerIterator(), + fd_arr_(), + is_ready_(false), + fd_idx_(-1) +{ +} + +ObAllVirtualTmpFileInfo::~ObAllVirtualTmpFileInfo() +{ + reset(); +} + +void ObAllVirtualTmpFileInfo::reset() +{ + // release tenant resources first + omt::ObMultiTenantOperator::reset(); + ip_buffer_[0] = '\0'; + trace_id_buffer_[0] = '\0'; + fd_arr_.reset(); + is_ready_ = false; + fd_idx_ = -1; + ObVirtualTableScannerIterator::reset(); +} + +void ObAllVirtualTmpFileInfo::release_last_tenant() +{ + // resources related with tenant must be released by this function + fd_arr_.reset(); + is_ready_ = false; + fd_idx_ = -1; +} + +bool ObAllVirtualTmpFileInfo::is_need_process(uint64_t tenant_id) +{ + bool bool_ret = false; + if (is_sys_tenant(effective_tenant_id_) || tenant_id == effective_tenant_id_) { + bool_ret = true; + } + + return bool_ret; +} + +int ObAllVirtualTmpFileInfo::get_next_tmp_file_info_(tmp_file::ObSNTmpFileInfo &tmp_file_info) +{ + int ret = OB_SUCCESS; + if (OB_UNLIKELY(0 > fd_idx_)) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN, "unexpected fd_idx_", KR(ret), K(fd_idx_)); + } else { + bool has_get = false; + while (OB_SUCC(ret) + && !has_get) { + if (fd_idx_ >= fd_arr_.count()) { + ret = OB_ITER_END; + SERVER_LOG(INFO, "iterate current tenant reach end", K(fd_idx_), K(fd_arr_.count())); + } else if (OB_FAIL(FILE_MANAGER_INSTANCE_V2.get_tmp_file_info(fd_arr_.at(fd_idx_), tmp_file_info))) { + if (OB_ENTRY_NOT_EXIST == ret || OB_TIMEOUT == ret) { + SERVER_LOG(INFO, "tmp file does not exist or is locked by others", KR(ret), K(fd_arr_.at(fd_idx_))); + ret = OB_SUCCESS; + } else { + SERVER_LOG(WARN, "fail to get tmp file info", KR(ret), K(fd_idx_), K(fd_arr_), K(fd_arr_.at(fd_idx_))); + } + } else { + has_get = true; + } + if (OB_SUCC(ret)) { + fd_idx_++; + } + } + } + return ret; +} + +int ObAllVirtualTmpFileInfo::process_curr_tenant(common::ObNewRow *&row) +{ + int ret = OB_SUCCESS; + + if (nullptr == allocator_) { + ret = OB_NOT_INIT; + SERVER_LOG(WARN, "allocator_ shouldn't be nullptr", K(allocator_), KR(ret)); + } else if (FALSE_IT(start_to_read_ = true)) { + } else if (!is_ready_) { + if (OB_UNLIKELY(!fd_arr_.empty())) { + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN, "unexpected fd_arr_", KR(ret), K(fd_arr_)); + } else if (OB_FAIL(FILE_MANAGER_INSTANCE_V2.get_tmp_file_fds(fd_arr_))) { + SERVER_LOG(WARN, "fail to get tmp file fd arr", KR(ret)); + if (OB_NOT_INIT == ret) { + ret = OB_SUCCESS; + } + } + if (OB_SUCC(ret)) { + is_ready_ = true; + fd_idx_ = 0; + } + } + + if (OB_SUCC(ret)) { + tmp_file::ObSNTmpFileInfo tmp_file_info; + if (OB_FAIL(get_next_tmp_file_info_(tmp_file_info))) { + if (OB_ITER_END != ret) { + SERVER_LOG(WARN, "fail to get next tmp file info", KR(ret)); + } + } else { + const int64_t col_count = output_column_ids_.count(); + ObAddr self_addr = GCONF.self_addr_; + for (int64_t i = 0; OB_SUCC(ret) && i < col_count; ++i) { + uint64_t col_id = output_column_ids_.at(i); + switch (col_id) { + case TENANT_ID: + cur_row_.cells_[i].set_int(tmp_file_info.tenant_id_); + break; + case SVR_IP: + MEMSET(ip_buffer_, '\0', OB_IP_STR_BUFF); + (void)self_addr.ip_to_string(ip_buffer_, common::OB_IP_STR_BUFF); + cur_row_.cells_[i].set_varchar(ip_buffer_); + cur_row_.cells_[i].set_default_collation_type(); + break; + case SVR_PORT: + cur_row_.cells_[i].set_int(self_addr.get_port()); + break; + case FILE_ID: + cur_row_.cells_[i].set_int(tmp_file_info.fd_); + break; + case TRACE_ID: + MEMSET(trace_id_buffer_, '\0', OB_MAX_TRACE_ID_BUFFER_SIZE); + if (!tmp_file_info.trace_id_.is_invalid()) { + tmp_file_info.trace_id_.to_string(trace_id_buffer_, OB_MAX_TRACE_ID_BUFFER_SIZE); + } + cur_row_.cells_[i].set_varchar(trace_id_buffer_); + cur_row_.cells_[i].set_default_collation_type(); + break; + case DIR_ID: + cur_row_.cells_[i].set_int(tmp_file_info.dir_id_); + break; + case BYTES: + cur_row_.cells_[i].set_int(tmp_file_info.file_size_); + break; + case START_OFFSET: + cur_row_.cells_[i].set_int(tmp_file_info.truncated_offset_); + break; + case IS_DELETING: + cur_row_.cells_[i].set_bool(tmp_file_info.is_deleting_); + break; + case CACHED_PAGE_NUM: + cur_row_.cells_[i].set_int(tmp_file_info.cached_page_num_); + break; + case WRITE_BACK_PAGE_NUM: + cur_row_.cells_[i].set_int(tmp_file_info.write_back_data_page_num_); + break; + case FLUSHED_PAGE_NUM: + cur_row_.cells_[i].set_int(tmp_file_info.flushed_data_page_num_); + break; + case REF_CNT: + cur_row_.cells_[i].set_int(tmp_file_info.ref_cnt_); + break; + case TOTAL_WRITES: + cur_row_.cells_[i].set_int(tmp_file_info.write_req_cnt_); + break; + case UNALIGNED_WRITES: + cur_row_.cells_[i].set_int(tmp_file_info.unaligned_write_req_cnt_); + break; + case TOTAL_READS: + cur_row_.cells_[i].set_int(tmp_file_info.read_req_cnt_); + break; + case UNALIGNED_READS: + cur_row_.cells_[i].set_int(tmp_file_info.unaligned_read_req_cnt_); + break; + case TOTAL_READ_BYTES: + cur_row_.cells_[i].set_int(tmp_file_info.total_read_size_); + break; + case LAST_ACCESS_TIME: + cur_row_.cells_[i].set_timestamp(tmp_file_info.last_access_ts_); + break; + case LAST_MODIFY_TIME: + cur_row_.cells_[i].set_timestamp(tmp_file_info.last_modify_ts_); + break; + case BIRTH_TIME: + cur_row_.cells_[i].set_timestamp(tmp_file_info.birth_ts_); + break; + default: + ret = OB_ERR_UNEXPECTED; + SERVER_LOG(WARN, "invalid coloum_id", KR(ret), K(col_id)); + break; + } + } + } + } + if (OB_SUCC(ret)) { + row = &cur_row_; + } + return ret; +} + +} +} diff --git a/src/observer/virtual_table/ob_all_virtual_tmp_file.h b/src/observer/virtual_table/ob_all_virtual_tmp_file.h new file mode 100644 index 000000000..8481774dc --- /dev/null +++ b/src/observer/virtual_table/ob_all_virtual_tmp_file.h @@ -0,0 +1,81 @@ +/** + * Copyright (c) 2023 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. + */ + +#ifndef OB_ALL_VIRTUAL_TMP_FILE_H_ +#define OB_ALL_VIRTUAL_TMP_FILE_H_ + +#include "share/ob_virtual_table_scanner_iterator.h" +#include "common/ob_clock_generator.h" +#include "observer/omt/ob_multi_tenant_operator.h" + +namespace oceanbase +{ +namespace tmp_file +{ +class ObSNTmpFileInfo; +} +namespace observer +{ + +class ObAllVirtualTmpFileInfo: public common::ObVirtualTableScannerIterator, + public omt::ObMultiTenantOperator +{ +public: + ObAllVirtualTmpFileInfo(); + ~ObAllVirtualTmpFileInfo(); + +public: + virtual int inner_get_next_row(common::ObNewRow *&row) { return execute(row);} + virtual void reset(); + +private: + virtual bool is_need_process(uint64_t tenant_id) override; + virtual int process_curr_tenant(common::ObNewRow *&row) override; + virtual void release_last_tenant() override; + int get_next_tmp_file_info_(tmp_file::ObSNTmpFileInfo &tmp_file_info); + +private: + enum + { + TENANT_ID = common::OB_APP_MIN_COLUMN_ID, + SVR_IP, + SVR_PORT, + FILE_ID, + TRACE_ID, + DIR_ID, + BYTES, + START_OFFSET, + IS_DELETING, + CACHED_PAGE_NUM, + WRITE_BACK_PAGE_NUM, + FLUSHED_PAGE_NUM, + REF_CNT, + TOTAL_WRITES, + UNALIGNED_WRITES, + TOTAL_READS, + UNALIGNED_READS, + TOTAL_READ_BYTES, + LAST_ACCESS_TIME, + LAST_MODIFY_TIME, + BIRTH_TIME + }; + char ip_buffer_[common::OB_IP_STR_BUFF]; + char trace_id_buffer_[common::OB_MAX_TRACE_ID_BUFFER_SIZE]; + ObArray fd_arr_; + bool is_ready_; + int64_t fd_idx_; + DISALLOW_COPY_AND_ASSIGN(ObAllVirtualTmpFileInfo); +}; + +} +} +#endif /* OB_ALL_VIRTUAL_TMP_FILE_H_ */ diff --git a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp index 04c198807..daf90b5f3 100644 --- a/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp +++ b/src/observer/virtual_table/ob_virtual_table_iterator_factory.cpp @@ -233,6 +233,7 @@ #include "observer/virtual_table/ob_information_schema_enable_roles_table.h" #include "observer/virtual_table/ob_all_virtual_tenant_scheduler_running_job.h" #include "observer/virtual_table/ob_all_virtual_compatibility_control.h" +#include "observer/virtual_table/ob_all_virtual_tmp_file.h" namespace oceanbase { @@ -2779,6 +2780,18 @@ int ObVTIterCreator::create_vt_iter(ObVTableScanParam ¶ms, } break; } + case OB_ALL_VIRTUAL_TEMP_FILE_TID: + { + ObAllVirtualTmpFileInfo *all_tmp_file_info = NULL; + if (OB_FAIL(NEW_VIRTUAL_TABLE(ObAllVirtualTmpFileInfo, all_tmp_file_info))) { + SERVER_LOG(ERROR, "ObAllVirtualTmpFileInfo construct failed", K(ret)); + } else if (OB_FAIL(all_tmp_file_info->init())) { + SERVER_LOG(WARN, "fail to init all_tmp_file_info", K(ret)); + } else { + vt_iter = static_cast(all_tmp_file_info); + } + break; + } END_CREATE_VT_ITER_SWITCH_LAMBDA #define AGENT_VIRTUAL_TABLE_CREATE_ITER diff --git a/src/share/inner_table/ob_inner_table_schema.12501_12550.cpp b/src/share/inner_table/ob_inner_table_schema.12501_12550.cpp new file mode 100644 index 000000000..67f5b51f2 --- /dev/null +++ b/src/share/inner_table/ob_inner_table_schema.12501_12550.cpp @@ -0,0 +1,402 @@ +/** + * 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::all_virtual_temp_file_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_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TEMP_FILE_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(VIRTUAL_TABLE); + 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_ALL_VIRTUAL_TEMP_FILE_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)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_ip", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 1, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_port", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 2, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("file_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trace_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TRACE_ID_BUFFER_SIZE, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dir_id", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("bytes", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("start_offset", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("is_deleting", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTinyIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + 1, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("cached_page_num", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("write_back_page_num", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("flushed_page_num", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ref_cnt", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("total_writes", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("unaligned_writes", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("total_reads", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("unaligned_reads", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("total_read_bytes", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("last_access_time", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("last_modify_time", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("birth_time", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + if (OB_SUCC(ret)) { + table_schema.get_part_option().set_part_num(1); + table_schema.set_part_level(PARTITION_LEVEL_ONE); + table_schema.get_part_option().set_part_func_type(PARTITION_FUNC_TYPE_LIST_COLUMNS); + if (OB_FAIL(table_schema.get_part_option().set_part_expr("svr_ip, svr_port"))) { + LOG_WARN("set_part_expr failed", K(ret)); + } else if (OB_FAIL(table_schema.mock_list_partition_array())) { + LOG_WARN("mock list partition array failed", K(ret)); + } + } + table_schema.set_index_using_type(USING_HASH); + 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.15451_15500.cpp b/src/share/inner_table/ob_inner_table_schema.15451_15500.cpp index 7a24d085e..c00587808 100644 --- a/src/share/inner_table/ob_inner_table_schema.15451_15500.cpp +++ b/src/share/inner_table/ob_inner_table_schema.15451_15500.cpp @@ -1220,6 +1220,375 @@ int ObInnerTableSchema::all_virtual_spatial_reference_systems_real_agent_ora_sch return ret; } +int ObInnerTableSchema::all_virtual_temp_file_ora_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TEMP_FILE_ORA_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(VIRTUAL_TABLE); + 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_ALL_VIRTUAL_TEMP_FILE_ORA_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SVR_IP", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 1, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SVR_PORT", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 2, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FILE_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRACE_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TRACE_ID_BUFFER_SIZE, //column_length + 2, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DIR_ID", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("BYTES", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("START_OFFSET", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("IS_DELETING", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CACHED_PAGE_NUM", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("WRITE_BACK_PAGE_NUM", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FLUSHED_PAGE_NUM", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("REF_CNT", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TOTAL_WRITES", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("UNALIGNED_WRITES", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TOTAL_READS", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("UNALIGNED_READS", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TOTAL_READ_BYTES", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LAST_ACCESS_TIME", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LAST_MODIFY_TIME", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("BIRTH_TIME", //column_name + ++column_id, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false); //is_autoincrement + } + if (OB_SUCC(ret)) { + table_schema.get_part_option().set_part_num(1); + table_schema.set_part_level(PARTITION_LEVEL_ONE); + table_schema.get_part_option().set_part_func_type(PARTITION_FUNC_TYPE_LIST); + if (OB_FAIL(table_schema.get_part_option().set_part_expr("SVR_IP, SVR_PORT"))) { + LOG_WARN("set_part_expr failed", K(ret)); + } else if (OB_FAIL(table_schema.mock_list_partition_array())) { + LOG_WARN("mock list partition array failed", K(ret)); + } + } + table_schema.set_index_using_type(USING_HASH); + 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.21601_21650.cpp b/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp index 39deefdd4..458b98ea1 100644 --- a/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp +++ b/src/share/inner_table/ob_inner_table_schema.21601_21650.cpp @@ -175,6 +175,106 @@ int ObInnerTableSchema::innodb_sys_foreign_cols_schema(ObTableSchema &table_sche return ret; } +int ObInnerTableSchema::dba_ob_temp_files_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_SYS_DATABASE_ID); + table_schema.set_table_id(OB_DBA_OB_TEMP_FILES_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_DBA_OB_TEMP_FILES_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 SVR_IP, SVR_PORT, FILE_ID, TRACE_ID, DIR_ID, BYTES, START_OFFSET, TOTAL_WRITES, UNALIGNED_WRITES, TOTAL_READS, UNALIGNED_READS, TOTAL_READ_BYTES, LAST_ACCESS_TIME, LAST_MODIFY_TIME, BIRTH_TIME FROM oceanbase.__all_virtual_temp_file WHERE TENANT_ID = EFFECTIVE_TENANT_ID() )__"))) { + 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::cdb_ob_temp_files_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_SYS_DATABASE_ID); + table_schema.set_table_id(OB_CDB_OB_TEMP_FILES_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_CDB_OB_TEMP_FILES_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 TENANT_ID, SVR_IP, SVR_PORT, FILE_ID, TRACE_ID, DIR_ID, BYTES, START_OFFSET, TOTAL_WRITES, UNALIGNED_WRITES, TOTAL_READS, UNALIGNED_READS, TOTAL_READ_BYTES, LAST_ACCESS_TIME, LAST_MODIFY_TIME, BIRTH_TIME FROM oceanbase.__all_virtual_temp_file )__"))) { + 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.28201_28250.cpp b/src/share/inner_table/ob_inner_table_schema.28201_28250.cpp index 981297c68..720771e35 100644 --- a/src/share/inner_table/ob_inner_table_schema.28201_28250.cpp +++ b/src/share/inner_table/ob_inner_table_schema.28201_28250.cpp @@ -925,19756 +925,6 @@ int ObInnerTableSchema::dba_ob_spatial_columns_ora_schema(ObTableSchema &table_s return ret; } -int ObInnerTableSchema::all_table_idx_data_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_IDX_DATA_TABLE_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_DATA_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_IDX_DATA_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("data_table_id", //column_name - column_id + 21, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_TID); - - table_schema.set_max_used_column_id(column_id + 21); - return ret; -} - -int ObInnerTableSchema::all_table_idx_db_tb_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_IDX_DB_TB_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_DB_TB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_IDX_DB_TB_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj table_name_default; - table_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("table_name", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - table_name_default, - table_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_table_idx_tb_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_IDX_TB_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_TB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_IDX_TB_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj table_name_default; - table_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("table_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - table_name_default, - table_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_column_idx_tb_column_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj column_name_default; - column_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("column_name", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - column_name_default, - column_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_COLUMN_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_column_idx_column_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_COLUMN_IDX_COLUMN_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_IDX_COLUMN_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_COLUMN_IDX_COLUMN_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj column_name_default; - column_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("column_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - column_name_default, - column_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_COLUMN_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_ddl_operation_idx_ddl_type_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("operation_type", //column_name - column_id + 9, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DDL_OPERATION_TID); - - table_schema.set_max_used_column_id(column_id + 9); - return ret; -} - -int ObInnerTableSchema::all_table_history_idx_data_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("data_table_id", //column_name - column_id + 23, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 23); - return ret; -} - -int ObInnerTableSchema::all_log_archive_piece_files_idx_status_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dest_id", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj file_status_default; - file_status_default.set_varchar(ObString::make_string("INVALID")); - ADD_COLUMN_SCHEMA_T("file_status", //column_name - column_id + 18, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_DEFAULT_STATUS_LENTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - file_status_default, - file_status_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("round_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("piece_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_LOG_ARCHIVE_PIECE_FILES_TID); - - table_schema.set_max_used_column_id(column_id + 18); - return ret; -} - -int ObInnerTableSchema::all_backup_set_files_idx_status_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dest_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("file_status", //column_name - column_id + 11, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_DEFAULT_STATUS_LENTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("backup_set_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_BACKUP_SET_FILES_TID); - - table_schema.set_max_used_column_id(column_id + 11); - return ret; -} - -int ObInnerTableSchema::all_ddl_task_status_idx_task_key_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("target_object_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 6, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name - column_id + 32768, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false,//is_autoincrement - true,//is_hidden - false);//is_storing_column - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 1, //column_id - 0, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_data_table_id(OB_ALL_DDL_TASK_STATUS_TID); - - table_schema.set_max_used_column_id(column_id + 32768); - return ret; -} - -int ObInnerTableSchema::all_user_idx_ur_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_USER_IDX_UR_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_IDX_UR_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_USER_IDX_UR_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_USER_NAME_LENGTH_STORE, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_USER_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_database_idx_db_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DATABASE_IDX_DB_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DATABASE_IDX_DB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DATABASE_IDX_DB_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj database_name_default; - database_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("database_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - database_name_default, - database_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DATABASE_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tablegroup_idx_tg_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLEGROUP_IDX_TG_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLEGROUP_IDX_TG_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLEGROUP_IDX_TG_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablegroup_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLEGROUP_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablegroup_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLEGROUP_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_history_idx_tenant_deleted_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("is_deleted", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_rootservice_event_history_idx_rs_module_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_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())); - 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(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("module", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj gmt_default; - ObObj gmt_default_null; - - gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); - gmt_default_null.set_null(); - ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - 6, //column_scale - false, //is_nullable - false, //is_autoincrement - false, //is_on_update_for_timestamp - gmt_default_null, - gmt_default); - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_rootservice_event_history_idx_rs_event_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_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())); - 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(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("event", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj gmt_default; - ObObj gmt_default_null; - - gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); - gmt_default_null.set_null(); - ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - 6, //column_scale - false, //is_nullable - false, //is_autoincrement - false, //is_on_update_for_timestamp - gmt_default_null, - gmt_default); - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_recyclebin_idx_recyclebin_db_type_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_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)) { - ++column_id; // for gmt_create - } - 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(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_name", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_OBJECT_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RECYCLEBIN_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_part_idx_part_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PART_IDX_PART_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PART_IDX_PART_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PART_IDX_PART_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj part_name_default; - part_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("part_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - part_name_default, - part_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("part_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PART_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_sub_part_idx_sub_part_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj sub_part_name_default; - sub_part_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("sub_part_name", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - sub_part_name_default, - sub_part_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("part_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sub_part_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SUB_PART_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_def_sub_part_idx_def_sub_part_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj sub_part_name_default; - sub_part_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("sub_part_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - sub_part_name_default, - sub_part_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sub_part_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DEF_SUB_PART_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_server_event_history_idx_server_module_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_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())); - 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(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("module", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj gmt_default; - ObObj gmt_default_null; - - gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); - gmt_default_null.set_null(); - ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - 6, //column_scale - false, //is_nullable - false, //is_autoincrement - false, //is_on_update_for_timestamp - gmt_default_null, - gmt_default); - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_ip", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_port", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SERVER_EVENT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_server_event_history_idx_server_event_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_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())); - 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(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("event", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj gmt_default; - ObObj gmt_default_null; - - gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); - gmt_default_null.set_null(); - ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - 6, //column_scale - false, //is_nullable - false, //is_autoincrement - false, //is_on_update_for_timestamp - gmt_default_null, - gmt_default); - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_ip", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_port", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SERVER_EVENT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_rootservice_job_idx_rs_job_type_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job_type", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_JOB_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_foreign_key_idx_fk_child_tid_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("child_table_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("foreign_key_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_foreign_key_idx_fk_parent_tid_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("parent_table_id", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("foreign_key_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_foreign_key_idx_fk_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj foreign_key_name_default; - foreign_key_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("foreign_key_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - foreign_key_name_default, - foreign_key_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("foreign_key_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_foreign_key_history_idx_fk_his_child_tid_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("child_table_id", //column_name - column_id + 6, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("foreign_key_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_foreign_key_history_idx_fk_his_parent_tid_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("parent_table_id", //column_name - column_id + 7, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("foreign_key_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_synonym_idx_db_synonym_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj synonym_name_default; - synonym_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("synonym_name", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SYNONYM_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - synonym_name_default, - synonym_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("synonym_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SYNONYM_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_synonym_idx_synonym_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj synonym_name_default; - synonym_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("synonym_name", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SYNONYM_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - synonym_name_default, - synonym_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("synonym_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SYNONYM_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_ddl_checksum_idx_ddl_checksum_task_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_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(6); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ddl_task_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("execution_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_id", //column_name - column_id + 5, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 6, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DDL_CHECKSUM_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_routine_idx_db_routine_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_name", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_ROUTINE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_routine_idx_routine_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_name", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_ROUTINE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_routine_idx_routine_pkg_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("package_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_routine_param_idx_routine_param_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj param_name_default; - param_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("param_name", //column_name - column_id + 7, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - true, //is_nullable - false, //is_autoincrement - param_name_default, - param_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("routine_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sequence", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ROUTINE_PARAM_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_package_idx_db_pkg_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj package_name_default; - package_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("package_name", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_PACKAGE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - package_name_default, - package_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("package_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PACKAGE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_package_idx_pkg_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PACKAGE_IDX_PKG_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PACKAGE_IDX_PKG_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PACKAGE_IDX_PKG_NAME_TID); - - if (OB_SUCC(ret)) { - ObObj package_name_default; - package_name_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("package_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_PACKAGE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - package_name_default, - package_name_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("package_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PACKAGE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_acquired_snapshot_idx_snapshot_tablet_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_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())); - 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(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablet_id", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj gmt_default; - ObObj gmt_default_null; - - gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); - gmt_default_null.set_null(); - ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - 6, //column_scale - false, //is_nullable - false, //is_autoincrement - false, //is_on_update_for_timestamp - gmt_default_null, - gmt_default); - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_ACQUIRED_SNAPSHOT_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_constraint_idx_cst_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_CONSTRAINT_IDX_CST_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_CONSTRAINT_IDX_CST_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_CONSTRAINT_IDX_CST_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("constraint_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("constraint_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_CONSTRAINT_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_type_idx_db_type_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TYPE_IDX_DB_TYPE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_IDX_DB_TYPE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TYPE_IDX_DB_TYPE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type_name", //column_name - column_id + 18, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TYPE_TID); - - table_schema.set_max_used_column_id(column_id + 18); - return ret; -} - -int ObInnerTableSchema::all_type_idx_type_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TYPE_IDX_TYPE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_IDX_TYPE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TYPE_IDX_TYPE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type_name", //column_name - column_id + 18, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TYPE_TID); - - table_schema.set_max_used_column_id(column_id + 18); - return ret; -} - -int ObInnerTableSchema::all_type_attr_idx_type_attr_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("name", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("attribute", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TYPE_ATTR_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_coll_type_idx_coll_name_type_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("coll_name", //column_name - column_id + 16, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("coll_type", //column_name - column_id + 13, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("coll_type_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_COLL_TYPE_TID); - - table_schema.set_max_used_column_id(column_id + 16); - return ret; -} - -int ObInnerTableSchema::all_dblink_idx_owner_dblink_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("owner_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dblink_name", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DBLINK_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dblink_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DBLINK_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_dblink_idx_dblink_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DBLINK_IDX_DBLINK_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBLINK_IDX_DBLINK_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DBLINK_IDX_DBLINK_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dblink_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DBLINK_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dblink_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DBLINK_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_role_grantee_map_idx_grantee_role_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("role_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantee_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_role_grantee_map_history_idx_grantee_his_role_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("role_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 4, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantee_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_keystore_idx_keystore_master_key_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("master_key_id", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("keystore_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_KEYSTORE_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_tenant_keystore_history_idx_keystore_his_master_key_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("master_key_id", //column_name - column_id + 8, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("keystore_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_KEYSTORE_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 8); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_policy_idx_ols_policy_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("policy_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_POLICY_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_policy_idx_ols_policy_col_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_POLICY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_component_idx_ols_com_policy_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("comp_type", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_component_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_COMPONENT_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_policy_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_label_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_tag_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_tag", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_label_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_label_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_user_level_idx_ols_level_uid_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_user_level_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_ols_user_level_idx_ols_level_policy_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("label_se_user_level_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_profile_idx_profile_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("profile_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_ORACLE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("profile_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_PROFILE_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_security_audit_idx_audit_type_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("audit_type", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObUInt64Type, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(uint64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("audit_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_SECURITY_AUDIT_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_trigger_idx_trigger_base_obj_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("base_object_id", //column_name - column_id + 11, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); - - table_schema.set_max_used_column_id(column_id + 11); - return ret; -} - -int ObInnerTableSchema::all_tenant_trigger_idx_db_trigger_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_name", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TRIGGER_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_trigger_idx_trigger_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TRIGGER_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_tenant_trigger_history_idx_trigger_his_base_obj_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("base_object_id", //column_name - column_id + 12, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trigger_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 12); - return ret; -} - -int ObInnerTableSchema::all_tenant_objauth_idx_objauth_grantor_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_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(7); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantor_id", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("obj_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("objtype", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("col_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantee_id", //column_name - column_id + 6, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("priv_id", //column_name - column_id + 7, //column_id - 7, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OBJAUTH_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_tenant_objauth_idx_objauth_grantee_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_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(7); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantee_id", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("obj_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("objtype", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("col_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("grantor_id", //column_name - column_id + 5, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("priv_id", //column_name - column_id + 7, //column_id - 7, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OBJAUTH_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_tenant_object_type_idx_obj_type_db_obj_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 13, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_name", //column_name - column_id + 17, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_type_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type", //column_name - column_id + 3, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OBJECT_TYPE_TID); - - table_schema.set_max_used_column_id(column_id + 17); - return ret; -} - -int ObInnerTableSchema::all_tenant_object_type_idx_obj_type_obj_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_name", //column_name - column_id + 17, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_type_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_OBJECT_TYPE_TID); - - table_schema.set_max_used_column_id(column_id + 17); - return ret; -} - -int ObInnerTableSchema::all_tenant_global_transaction_idx_xa_trans_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trans_id", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("gtrid", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("bqual", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj format_id_default; - format_id_default.set_int(1); - ADD_COLUMN_SCHEMA_T("format_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - format_id_default, - format_id_default); //default_value - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_GLOBAL_TRANSACTION_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_tenant_dependency_idx_dependency_ref_obj_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ref_obj_id", //column_name - column_id + 8, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ref_obj_type", //column_name - column_id + 7, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dep_obj_type", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dep_obj_id", //column_name - column_id + 3, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("dep_order", //column_name - column_id + 4, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_DEPENDENCY_TID); - - table_schema.set_max_used_column_id(column_id + 8); - return ret; -} - -int ObInnerTableSchema::all_ddl_error_message_idx_ddl_error_object_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_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(7); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("target_object_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 5, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_ip", //column_name - column_id + 6, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - MAX_IP_ADDR_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("svr_port", //column_name - column_id + 7, //column_id - 7, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DDL_ERROR_MESSAGE_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_table_stat_history_idx_table_stat_his_savtime_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("savtime", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("partition_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_STAT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_column_stat_history_idx_column_stat_his_savtime_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_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(5); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("savtime", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("partition_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_COLUMN_STAT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_histogram_stat_history_idx_histogram_stat_his_savtime_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_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(6); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("savtime", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("partition_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("endpoint_num", //column_name - column_id + 5, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_HISTOGRAM_STAT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_tablet_to_ls_idx_tablet_to_ls_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ls_id", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablet_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLET_TO_LS_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_tablet_to_ls_idx_tablet_to_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablet_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLET_TO_LS_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_pending_transaction_idx_pending_tx_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("gtrid", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("bqual", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ObObj format_id_default; - format_id_default.set_int(1); - ADD_COLUMN_SCHEMA_T("format_id", //column_name - column_id + 5, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - format_id_default, - format_id_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("trans_id", //column_name - column_id + 2, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PENDING_TRANSACTION_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_context_idx_ctx_namespace_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_TID); - - if (OB_SUCC(ret)) { - ObObj namespace_default; - namespace_default.set_varchar(ObString::make_string("")); - ADD_COLUMN_SCHEMA_T("namespace", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_CONTEXT_STRING_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - namespace_default, - namespace_default); //default_value - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("context_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_CONTEXT_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_plan_baseline_item_idx_spm_item_sql_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sql_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SQL_ID_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObUInt64Type, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(uint64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("plan_hash_value", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObUInt64Type, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(uint64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PLAN_BASELINE_ITEM_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_plan_baseline_item_idx_spm_item_value_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("plan_hash_value", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObUInt64Type, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(uint64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObUInt64Type, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(uint64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sql_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SQL_ID_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_PLAN_BASELINE_ITEM_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_tenant_directory_idx_directory_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("directory_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("directory_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_DIRECTORY_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_job_idx_job_powner_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_JOB_IDX_JOB_POWNER_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_JOB_IDX_JOB_POWNER_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_JOB_IDX_JOB_POWNER_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("powner", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_JOB_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_sequence_object_idx_seq_obj_db_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sequence_name", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SEQUENCE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sequence_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SEQUENCE_OBJECT_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_sequence_object_idx_seq_obj_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sequence_name", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_SEQUENCE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("sequence_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SEQUENCE_OBJECT_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_recyclebin_idx_recyclebin_ori_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_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)) { - ++column_id; // for gmt_create - } - 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(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("original_name", //column_name - column_id + 7, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_ORIGINAL_NANE_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_name", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_OBJECT_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("type", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RECYCLEBIN_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_table_privilege_idx_tb_priv_db_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_name", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_PRIVILEGE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_table_privilege_idx_tb_priv_tb_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_name", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_name", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_TABLE_PRIVILEGE_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_database_privilege_idx_db_priv_db_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DATABASE_PRIVILEGE_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_rls_policy_idx_rls_policy_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_policy_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_POLICY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_rls_policy_idx_rls_policy_group_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_group_id", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_policy_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_POLICY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_rls_policy_history_idx_rls_policy_his_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_policy_id", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_POLICY_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_rls_group_idx_rls_group_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_group_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_GROUP_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_rls_group_history_idx_rls_group_his_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_group_id", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_GROUP_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_rls_context_idx_rls_context_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_context_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_CONTEXT_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_rls_context_history_idx_rls_context_his_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("rls_context_id", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_RLS_CONTEXT_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_tenant_snapshot_idx_tenant_snapshot_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("snapshot_name", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - OB_MAX_TENANT_SNAPSHOT_NAME_LENGTH_STORE, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name - column_id + 32768, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false,//is_autoincrement - true,//is_hidden - false);//is_storing_column - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_1", //column_name - column_id + 32769, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false,//is_autoincrement - true,//is_hidden - false);//is_storing_column - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 0, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("snapshot_id", //column_name - column_id + 2, //column_id - 0, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_data_table_id(OB_ALL_TENANT_SNAPSHOT_TID); - - table_schema.set_max_used_column_id(column_id + 32769); - return ret; -} - -int ObInnerTableSchema::all_dbms_lock_allocated_idx_dbms_lock_allocated_lockhandle_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("lockhandle", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("name", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_dbms_lock_allocated_idx_dbms_lock_allocated_expiration_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("expiration", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("name", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_kv_ttl_task_idx_kv_ttl_task_table_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablet_id", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_KV_TTL_TASK_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_kv_ttl_task_history_idx_kv_ttl_task_history_upd_time_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_update_time", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tablet_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_KV_TTL_TASK_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_mview_refresh_run_stats_idx_mview_refresh_run_stats_num_mvs_current_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("num_mvs_current", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("refresh_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_RUN_STATS_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_mview_refresh_stats_idx_mview_refresh_stats_end_time_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("end_time", //column_name - column_id + 7, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("refresh_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("mview_id", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("retry_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_STATS_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_mview_refresh_stats_idx_mview_refresh_stats_mview_end_time_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("mview_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("end_time", //column_name - column_id + 7, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("refresh_id", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("retry_id", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_STATS_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_transfer_partition_task_idx_transfer_partition_key_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_id", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("object_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name - column_id + 32768, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false,//is_autoincrement - true,//is_hidden - false);//is_storing_column - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("task_id", //column_name - column_id + 1, //column_id - 0, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); - table_schema.set_data_table_id(OB_ALL_TRANSFER_PARTITION_TASK_TID); - - table_schema.set_max_used_column_id(column_id + 32768); - return ret; -} - -int ObInnerTableSchema::all_client_to_server_session_info_idx_client_to_server_session_info_client_session_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("client_session_id", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("server_session_id", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_column_privilege_idx_column_privilege_name_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("user_id", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("database_name", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 1024, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("table_name", //column_name - column_id + 5, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 1024, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("column_name", //column_name - column_id + 6, //column_id - 4, //rowkey_id - 4, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_BINARY, //column_collation_type - 1024, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("priv_id", //column_name - column_id + 2, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_COLUMN_PRIVILEGE_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_user_proxy_info_idx_user_proxy_info_proxy_user_id_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("proxy_user_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("client_user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_USER_PROXY_INFO_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_user_proxy_info_history_idx_user_proxy_info_proxy_user_id_history_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("proxy_user_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("client_user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_USER_PROXY_INFO_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_user_proxy_role_info_history_idx_user_proxy_role_info_proxy_user_id_history_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_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(5); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("tenant_id", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("proxy_user_id", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("client_user_id", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("role_id", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("schema_version", //column_name - column_id + 5, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObIntType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(int64_t), //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_scheduler_job_run_detail_v2_idx_scheduler_job_run_detail_v2_time_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("time", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job_name", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_scheduler_job_run_detail_v2_idx_scheduler_job_run_detail_v2_job_class_time_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_SYS_TABLEGROUP_ID); - table_schema.set_database_id(OB_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_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)) { - ++column_id; // for gmt_create - } - - if (OB_SUCC(ret)) { - ++column_id; // for gmt_modified - } - 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(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_TID); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job_class", //column_name - column_id + 8, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA_TS("time", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObTimestampType, //column_type - CS_TYPE_INVALID, //column_collation_type - sizeof(ObPreciseDateTime), //column_length - -1, //column_precision - -1, //column_scale - false, //is_nullable - false, //is_autoincrement - false); //is_on_update_for_timestamp - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("job_name", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_INVALID, //column_collation_type - 128, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_TID); - - table_schema.set_max_used_column_id(column_id + 8); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_data_table_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DATA_TABLE_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DATA_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATA_TABLE_ID", //column_name - column_id + 21, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 21); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_db_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DB_TB_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DB_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_TB_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_column_real_agent_ora_idx_tb_column_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_TB_COLUMN_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_TB_COLUMN_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_column_real_agent_ora_idx_column_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_COLUMN_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_COLUMN_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_user_real_agent_ora_idx_ur_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_IDX_UR_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_IDX_UR_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_USER_NAME_LENGTH_STORE, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_database_real_agent_ora_idx_db_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_IDX_DB_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_IDX_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tablegroup_real_agent_ora_idx_tg_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_IDX_TG_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_IDX_TG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLEGROUP_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLEGROUP_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLEGROUP_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_recyclebin_real_agent_ora_idx_recyclebin_db_type_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_DB_TYPE_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_DB_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE", //column_name - column_id + 3, //column_id - 3, //rowkey_id - 3, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_OBJECT_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_part_real_agent_ora_idx_part_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_IDX_PART_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_IDX_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PART_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PART_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_sub_part_real_agent_ora_idx_sub_part_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_IDX_SUB_PART_NAME_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_IDX_SUB_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SUB_PART_NAME", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PART_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SUB_PART_ID", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_def_sub_part_real_agent_ora_idx_def_sub_part_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_IDX_DEF_SUB_PART_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_IDX_DEF_SUB_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SUB_PART_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_PARTITION_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SUB_PART_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_child_tid_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_CHILD_TID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_CHILD_TID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("CHILD_TABLE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_parent_tid_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_PARENT_TID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_PARENT_TID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PARENT_TABLE_ID", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("FOREIGN_KEY_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_synonym_real_agent_ora_idx_db_synonym_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_DB_SYNONYM_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_DB_SYNONYM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SYNONYM_NAME", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SYNONYM_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SYNONYM_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_synonym_real_agent_ora_idx_synonym_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_SYNONYM_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_SYNONYM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SYNONYM_NAME", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SYNONYM_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SYNONYM_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_db_routine_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_DB_ROUTINE_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_DB_ROUTINE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_NAME", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_ROUTINE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_routine_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_NAME", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_ROUTINE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_routine_pkg_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_PKG_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_PKG_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_routine_param_real_agent_ora_idx_routine_param_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_IDX_ROUTINE_PARAM_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_IDX_ROUTINE_PARAM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PARAM_NAME", //column_name - column_id + 7, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SEQUENCE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_virtual_package_real_agent_ora_idx_db_pkg_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_DB_PKG_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_DB_PKG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PACKAGE_NAME", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_PACKAGE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_package_real_agent_ora_idx_pkg_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_PKG_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_PKG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PACKAGE_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_PACKAGE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_constraint_real_agent_ora_idx_cst_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_IDX_CST_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_IDX_CST_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("CONSTRAINT_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("CONSTRAINT_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_type_real_agent_ora_idx_db_type_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_DB_TYPE_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_DB_TYPE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE_NAME", //column_name - column_id + 18, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 18); - return ret; -} - -int ObInnerTableSchema::all_virtual_type_real_agent_ora_idx_type_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_TYPE_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_TYPE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE_NAME", //column_name - column_id + 18, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 18); - return ret; -} - -int ObInnerTableSchema::all_virtual_type_attr_real_agent_ora_idx_type_attr_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_IDX_TYPE_ATTR_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_IDX_TYPE_ATTR_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("NAME", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ATTRIBUTE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_virtual_coll_type_real_agent_ora_idx_coll_name_type_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_IDX_COLL_NAME_TYPE_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_IDX_COLL_NAME_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLL_NAME", //column_name - column_id + 16, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLL_TYPE", //column_name - column_id + 13, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLL_TYPE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 16); - return ret; -} - -int ObInnerTableSchema::all_virtual_dblink_real_agent_ora_idx_owner_dblink_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_OWNER_DBLINK_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_OWNER_DBLINK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OWNER_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DBLINK_NAME", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DBLINK_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DBLINK_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_dblink_real_agent_ora_idx_dblink_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_DBLINK_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_DBLINK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DBLINK_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DBLINK_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DBLINK_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_role_grantee_map_real_agent_ora_idx_grantee_role_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_IDX_GRANTEE_ROLE_ID_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_IDX_GRANTEE_ROLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ROLE_ID", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_keystore_real_agent_ora_idx_keystore_master_key_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_IDX_KEYSTORE_MASTER_KEY_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_IDX_KEYSTORE_MASTER_KEY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("MASTER_KEY_ID", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("KEYSTORE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_policy_real_agent_ora_idx_ols_policy_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("POLICY_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_policy_real_agent_ora_idx_ols_policy_col_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_COL_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_COL_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_component_real_agent_ora_idx_ols_com_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_IDX_OLS_COM_POLICY_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_IDX_OLS_COM_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COMP_TYPE", //column_name - column_id + 4, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_COMPONENT_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_POLICY_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_tag_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_TAG_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_TAG_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_TAG", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_COLUMN_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_user_level_real_agent_ora_idx_ols_level_uid_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_UID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_UID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_USER_LEVEL_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_ols_user_level_real_agent_ora_idx_ols_level_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_POLICY_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LABEL_SE_USER_LEVEL_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_profile_real_agent_ora_idx_profile_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_IDX_PROFILE_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_IDX_PROFILE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PROFILE_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - MAX_ORACLE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PROFILE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_security_audit_real_agent_ora_idx_audit_type_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_IDX_AUDIT_TYPE_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_IDX_AUDIT_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("AUDIT_TYPE", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("AUDIT_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_trigger_base_obj_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_BASE_OBJ_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_BASE_OBJ_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("BASE_OBJECT_ID", //column_name - column_id + 11, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 11); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_db_trigger_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_DB_TRIGGER_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_DB_TRIGGER_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TRIGGER_NAME", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TRIGGER_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_trigger_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TRIGGER_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TRIGGER_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_objauth_real_agent_ora_idx_objauth_grantor_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTOR_REAL_AGENT_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(7); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTOR_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("GRANTOR_ID", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJ_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJTYPE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COL_ID", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name - column_id + 6, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PRIV_ID", //column_name - column_id + 7, //column_id - 7, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_objauth_real_agent_ora_idx_objauth_grantee_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTEE_REAL_AGENT_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(7); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTEE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJ_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJTYPE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COL_ID", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("GRANTOR_ID", //column_name - column_id + 5, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PRIV_ID", //column_name - column_id + 7, //column_id - 7, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_object_type_real_agent_ora_idx_obj_type_db_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_DB_OBJ_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_DB_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 13, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name - column_id + 17, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_TYPE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE", //column_name - column_id + 3, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 17); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_object_type_real_agent_ora_idx_obj_type_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_OBJ_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name - column_id + 17, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_TABLE_TYPE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_TYPE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 17); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_dependency_real_agent_ora_idx_dependency_ref_obj_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_IDX_DEPENDENCY_REF_OBJ_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_IDX_DEPENDENCY_REF_OBJ_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("REF_OBJ_ID", //column_name - column_id + 8, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("REF_OBJ_TYPE", //column_name - column_id + 7, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DEP_OBJ_TYPE", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DEP_OBJ_ID", //column_name - column_id + 3, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DEP_ORDER", //column_name - column_id + 4, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 8); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_stat_history_real_agent_ora_idx_table_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_IDX_TABLE_STAT_HIS_SAVTIME_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_IDX_TABLE_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SAVTIME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_column_stat_history_real_agent_ora_idx_column_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_IDX_COLUMN_STAT_HIS_SAVTIME_REAL_AGENT_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(5); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_IDX_COLUMN_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SAVTIME", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_histogram_stat_history_real_agent_ora_idx_histogram_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_IDX_HISTOGRAM_STAT_HIS_SAVTIME_REAL_AGENT_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(6); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_IDX_HISTOGRAM_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SAVTIME", //column_name - column_id + 6, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name - column_id + 4, //column_id - 5, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ENDPOINT_NUM", //column_name - column_id + 5, //column_id - 6, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 6); - return ret; -} - -int ObInnerTableSchema::all_virtual_tablet_to_ls_real_agent_ora_idx_tablet_to_ls_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_LS_ID_REAL_AGENT_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_LS_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LS_ID", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLET_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_virtual_tablet_to_ls_real_agent_ora_idx_tablet_to_table_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_TABLE_ID_REAL_AGENT_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLET_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_context_real_agent_ora_idx_ctx_namespace_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_IDX_CTX_NAMESPACE_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_IDX_CTX_NAMESPACE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("NAMESPACE", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_CONTEXT_STRING_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("CONTEXT_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_plan_baseline_item_real_agent_ora_idx_spm_item_sql_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_SQL_ID_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_SQL_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SQL_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SQL_ID_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PLAN_HASH_VALUE", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_plan_baseline_item_real_agent_ora_idx_spm_item_value_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_VALUE_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_VALUE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PLAN_HASH_VALUE", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SQL_ID", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SQL_ID_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_tenant_directory_real_agent_ora_idx_directory_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_IDX_DIRECTORY_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_IDX_DIRECTORY_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DIRECTORY_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DIRECTORY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_job_real_agent_ora_idx_job_powner_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_IDX_JOB_POWNER_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_IDX_JOB_POWNER_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("POWNER", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("JOB", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_sequence_object_real_agent_ora_idx_seq_obj_db_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_DB_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SEQUENCE_NAME", //column_name - column_id + 5, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SEQUENCE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SEQUENCE_ID", //column_name - column_id + 2, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_sequence_object_real_agent_ora_idx_seq_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_NAME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SEQUENCE_NAME", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_SEQUENCE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("SEQUENCE_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_recyclebin_real_agent_ora_idx_recyclebin_ori_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_ORI_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_ORI_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("ORIGINAL_NAME", //column_name - column_id + 7, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_ORIGINAL_NANE_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_OBJECT_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TYPE", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 7); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_privilege_real_agent_ora_idx_tb_priv_db_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_DB_NAME_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name - column_id + 4, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_table_privilege_real_agent_ora_idx_tb_priv_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_TB_NAME_REAL_AGENT_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(4); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name - column_id + 3, //column_id - 4, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_database_privilege_real_agent_ora_idx_db_priv_db_name_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_IDX_DB_PRIV_DB_NAME_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_IDX_DB_PRIV_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - OB_MAX_DATABASE_NAME_LENGTH, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("USER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_rls_policy_real_agent_ora_idx_rls_policy_table_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_TABLE_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("RLS_POLICY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_rls_policy_real_agent_ora_idx_rls_policy_group_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_GROUP_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_GROUP_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("RLS_GROUP_ID", //column_name - column_id + 5, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("RLS_POLICY_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 5); - return ret; -} - -int ObInnerTableSchema::all_virtual_rls_group_real_agent_ora_idx_rls_group_table_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_IDX_RLS_GROUP_TABLE_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_IDX_RLS_GROUP_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("RLS_GROUP_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_rls_context_real_agent_ora_idx_rls_context_table_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_IDX_RLS_CONTEXT_TABLE_ID_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_IDX_RLS_CONTEXT_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TABLE_ID", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("RLS_CONTEXT_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_dbms_lock_allocated_real_agent_ora_idx_dbms_lock_allocated_lockhandle_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_REAL_AGENT_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("LOCKHANDLE", //column_name - column_id + 3, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("NAME", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_dbms_lock_allocated_real_agent_ora_idx_dbms_lock_allocated_expiration_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_REAL_AGENT_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(1); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("EXPIRATION", //column_name - column_id + 4, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("NAME", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 4); - return ret; -} - -int ObInnerTableSchema::all_virtual_user_proxy_info_real_agent_ora_idx_user_proxy_info_proxy_user_id_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_IDX_USER_PROXY_INFO_PROXY_USER_ID_REAL_AGENT_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(3); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_IDX_USER_PROXY_INFO_PROXY_USER_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TENANT_ID", //column_name - column_id + 1, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("PROXY_USER_ID", //column_name - column_id + 3, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("CLIENT_USER_ID", //column_name - column_id + 2, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObNumberType, //column_type - CS_TYPE_INVALID, //column_collation_type - 38, //column_length - 38, //column_precision - 0, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 3); - return ret; -} - -int ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_idx_scheduler_job_run_detail_v2_time_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TIME", //column_name - column_id + 2, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("JOB_NAME", //column_name - column_id + 1, //column_id - 2, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 2); - return ret; -} - -int ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_idx_scheduler_job_run_detail_v2_job_class_time_real_agent_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_ORA_SYS_DATABASE_ID); - table_schema.set_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_REAL_AGENT_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(2); - table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); - table_schema.set_table_type(USER_INDEX); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); - - if (OB_SUCC(ret)) { - if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); - 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); - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("JOB_CLASS", //column_name - column_id + 8, //column_id - 1, //rowkey_id - 1, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - true,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("TIME", //column_name - column_id + 2, //column_id - 2, //rowkey_id - 2, //index_id - 0, //part_key_pos - ObTimestampLTZType, //column_type - CS_TYPE_INVALID, //column_collation_type - 0, //column_length - -1, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - - if (OB_SUCC(ret)) { - ADD_COLUMN_SCHEMA("JOB_NAME", //column_name - column_id + 1, //column_id - 3, //rowkey_id - 0, //index_id - 0, //part_key_pos - ObVarcharType, //column_type - CS_TYPE_UTF8MB4_BIN, //column_collation_type - 128, //column_length - 2, //column_precision - -1, //column_scale - false,//is_nullable - false); //is_autoincrement - } - table_schema.set_index_status(INDEX_STATUS_AVAILABLE); - table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); - table_schema.set_data_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID); - - table_schema.set_max_used_column_id(column_id + 8); - return ret; -} - } // end namespace share } // end namespace oceanbase diff --git a/src/share/inner_table/ob_inner_table_schema.28251_28300.cpp b/src/share/inner_table/ob_inner_table_schema.28251_28300.cpp new file mode 100644 index 000000000..4d535519e --- /dev/null +++ b/src/share/inner_table/ob_inner_table_schema.28251_28300.cpp @@ -0,0 +1,19830 @@ +/** + * 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::dba_ob_temp_files_ora_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_DBA_OB_TEMP_FILES_ORA_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_DBA_OB_TEMP_FILES_ORA_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 SVR_IP, SVR_PORT, FILE_ID, TRACE_ID, DIR_ID, BYTES, START_OFFSET, TOTAL_WRITES, UNALIGNED_WRITES, TOTAL_READS, UNALIGNED_READS, TOTAL_READ_BYTES, LAST_ACCESS_TIME, LAST_MODIFY_TIME, BIRTH_TIME FROM SYS.ALL_VIRTUAL_TEMP_FILE WHERE TENANT_ID = EFFECTIVE_TENANT_ID() )__"))) { + 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::all_table_idx_data_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_IDX_DATA_TABLE_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_DATA_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_IDX_DATA_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("data_table_id", //column_name + column_id + 21, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_TID); + + table_schema.set_max_used_column_id(column_id + 21); + return ret; +} + +int ObInnerTableSchema::all_table_idx_db_tb_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_IDX_DB_TB_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_DB_TB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_IDX_DB_TB_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj table_name_default; + table_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("table_name", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + table_name_default, + table_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_table_idx_tb_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_IDX_TB_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_IDX_TB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_IDX_TB_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj table_name_default; + table_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("table_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + table_name_default, + table_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_column_idx_tb_column_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_COLUMN_IDX_TB_COLUMN_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj column_name_default; + column_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("column_name", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + column_name_default, + column_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_COLUMN_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_column_idx_column_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_COLUMN_IDX_COLUMN_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_IDX_COLUMN_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_COLUMN_IDX_COLUMN_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj column_name_default; + column_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("column_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + column_name_default, + column_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_COLUMN_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_ddl_operation_idx_ddl_type_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DDL_OPERATION_IDX_DDL_TYPE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("operation_type", //column_name + column_id + 9, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DDL_OPERATION_TID); + + table_schema.set_max_used_column_id(column_id + 9); + return ret; +} + +int ObInnerTableSchema::all_table_history_idx_data_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_HISTORY_IDX_DATA_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("data_table_id", //column_name + column_id + 23, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 23); + return ret; +} + +int ObInnerTableSchema::all_log_archive_piece_files_idx_status_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_LOG_ARCHIVE_PIECE_FILES_IDX_STATUS_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dest_id", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj file_status_default; + file_status_default.set_varchar(ObString::make_string("INVALID")); + ADD_COLUMN_SCHEMA_T("file_status", //column_name + column_id + 18, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_DEFAULT_STATUS_LENTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + file_status_default, + file_status_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("round_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("piece_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_LOG_ARCHIVE_PIECE_FILES_TID); + + table_schema.set_max_used_column_id(column_id + 18); + return ret; +} + +int ObInnerTableSchema::all_backup_set_files_idx_status_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_BACKUP_SET_FILES_IDX_STATUS_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dest_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("file_status", //column_name + column_id + 11, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_DEFAULT_STATUS_LENTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("backup_set_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_BACKUP_SET_FILES_TID); + + table_schema.set_max_used_column_id(column_id + 11); + return ret; +} + +int ObInnerTableSchema::all_ddl_task_status_idx_task_key_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DDL_TASK_STATUS_IDX_TASK_KEY_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("target_object_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 6, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name + column_id + 32768, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false,//is_autoincrement + true,//is_hidden + false);//is_storing_column + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 1, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_data_table_id(OB_ALL_DDL_TASK_STATUS_TID); + + table_schema.set_max_used_column_id(column_id + 32768); + return ret; +} + +int ObInnerTableSchema::all_user_idx_ur_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_USER_IDX_UR_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_IDX_UR_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_USER_IDX_UR_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_USER_NAME_LENGTH_STORE, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_USER_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_database_idx_db_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DATABASE_IDX_DB_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DATABASE_IDX_DB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DATABASE_IDX_DB_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj database_name_default; + database_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("database_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + database_name_default, + database_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DATABASE_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tablegroup_idx_tg_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLEGROUP_IDX_TG_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLEGROUP_IDX_TG_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLEGROUP_IDX_TG_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablegroup_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLEGROUP_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablegroup_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLEGROUP_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_history_idx_tenant_deleted_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_HISTORY_IDX_TENANT_DELETED_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("is_deleted", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_rootservice_event_history_idx_rs_module_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_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())); + 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(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_MODULE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("module", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj gmt_default; + ObObj gmt_default_null; + + gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); + gmt_default_null.set_null(); + ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + 6, //column_scale + false, //is_nullable + false, //is_autoincrement + false, //is_on_update_for_timestamp + gmt_default_null, + gmt_default); + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_rootservice_event_history_idx_rs_event_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_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())); + 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(OB_ALL_ROOTSERVICE_EVENT_HISTORY_IDX_RS_EVENT_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("event", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj gmt_default; + ObObj gmt_default_null; + + gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); + gmt_default_null.set_null(); + ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + 6, //column_scale + false, //is_nullable + false, //is_autoincrement + false, //is_on_update_for_timestamp + gmt_default_null, + gmt_default); + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_EVENT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_recyclebin_idx_recyclebin_db_type_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_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)) { + ++column_id; // for gmt_create + } + 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(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_DB_TYPE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_name", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_OBJECT_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RECYCLEBIN_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_part_idx_part_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PART_IDX_PART_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PART_IDX_PART_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PART_IDX_PART_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj part_name_default; + part_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("part_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + part_name_default, + part_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("part_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PART_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_sub_part_idx_sub_part_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SUB_PART_IDX_SUB_PART_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj sub_part_name_default; + sub_part_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("sub_part_name", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + sub_part_name_default, + sub_part_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("part_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sub_part_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SUB_PART_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_def_sub_part_idx_def_sub_part_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DEF_SUB_PART_IDX_DEF_SUB_PART_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj sub_part_name_default; + sub_part_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("sub_part_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + sub_part_name_default, + sub_part_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sub_part_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DEF_SUB_PART_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_server_event_history_idx_server_module_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_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())); + 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(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_MODULE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("module", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj gmt_default; + ObObj gmt_default_null; + + gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); + gmt_default_null.set_null(); + ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + 6, //column_scale + false, //is_nullable + false, //is_autoincrement + false, //is_on_update_for_timestamp + gmt_default_null, + gmt_default); + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_ip", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_port", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SERVER_EVENT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_server_event_history_idx_server_event_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_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())); + 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(OB_ALL_SERVER_EVENT_HISTORY_IDX_SERVER_EVENT_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("event", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_ROOTSERVICE_EVENT_DESC_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj gmt_default; + ObObj gmt_default_null; + + gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); + gmt_default_null.set_null(); + ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + 6, //column_scale + false, //is_nullable + false, //is_autoincrement + false, //is_on_update_for_timestamp + gmt_default_null, + gmt_default); + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_ip", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_port", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SERVER_EVENT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_rootservice_job_idx_rs_job_type_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_ROOTSERVICE_JOB_IDX_RS_JOB_TYPE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job_type", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROOTSERVICE_JOB_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_foreign_key_idx_fk_child_tid_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_FOREIGN_KEY_IDX_FK_CHILD_TID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("child_table_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("foreign_key_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_foreign_key_idx_fk_parent_tid_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_FOREIGN_KEY_IDX_FK_PARENT_TID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("parent_table_id", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("foreign_key_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_foreign_key_idx_fk_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_FOREIGN_KEY_IDX_FK_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj foreign_key_name_default; + foreign_key_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("foreign_key_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + foreign_key_name_default, + foreign_key_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("foreign_key_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_foreign_key_history_idx_fk_his_child_tid_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_CHILD_TID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("child_table_id", //column_name + column_id + 6, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("foreign_key_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_foreign_key_history_idx_fk_his_parent_tid_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_FOREIGN_KEY_HISTORY_IDX_FK_HIS_PARENT_TID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("parent_table_id", //column_name + column_id + 7, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("foreign_key_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_FOREIGN_KEY_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_synonym_idx_db_synonym_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SYNONYM_IDX_DB_SYNONYM_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj synonym_name_default; + synonym_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("synonym_name", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SYNONYM_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + synonym_name_default, + synonym_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("synonym_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SYNONYM_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_synonym_idx_synonym_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SYNONYM_IDX_SYNONYM_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj synonym_name_default; + synonym_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("synonym_name", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SYNONYM_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + synonym_name_default, + synonym_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("synonym_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SYNONYM_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_ddl_checksum_idx_ddl_checksum_task_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_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(6); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DDL_CHECKSUM_IDX_DDL_CHECKSUM_TASK_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ddl_task_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("execution_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_id", //column_name + column_id + 5, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 6, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DDL_CHECKSUM_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_routine_idx_db_routine_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_ROUTINE_IDX_DB_ROUTINE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_name", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_ROUTINE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_routine_idx_routine_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_ROUTINE_IDX_ROUTINE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_name", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_ROUTINE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_routine_idx_routine_pkg_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_ROUTINE_IDX_ROUTINE_PKG_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("package_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROUTINE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_routine_param_idx_routine_param_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_ROUTINE_PARAM_IDX_ROUTINE_PARAM_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj param_name_default; + param_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("param_name", //column_name + column_id + 7, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + true, //is_nullable + false, //is_autoincrement + param_name_default, + param_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("routine_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sequence", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ROUTINE_PARAM_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_package_idx_db_pkg_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PACKAGE_IDX_DB_PKG_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj package_name_default; + package_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("package_name", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_PACKAGE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + package_name_default, + package_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("package_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PACKAGE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_package_idx_pkg_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PACKAGE_IDX_PKG_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PACKAGE_IDX_PKG_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PACKAGE_IDX_PKG_NAME_TID); + + if (OB_SUCC(ret)) { + ObObj package_name_default; + package_name_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("package_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_PACKAGE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + package_name_default, + package_name_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("package_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PACKAGE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_acquired_snapshot_idx_snapshot_tablet_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_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())); + 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(OB_ALL_ACQUIRED_SNAPSHOT_IDX_SNAPSHOT_TABLET_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablet_id", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj gmt_default; + ObObj gmt_default_null; + + gmt_default.set_ext(ObActionFlag::OP_DEFAULT_NOW_FLAG); + gmt_default_null.set_null(); + ADD_COLUMN_SCHEMA_TS_T("gmt_create", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + 6, //column_scale + false, //is_nullable + false, //is_autoincrement + false, //is_on_update_for_timestamp + gmt_default_null, + gmt_default); + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_ACQUIRED_SNAPSHOT_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_constraint_idx_cst_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_CONSTRAINT_IDX_CST_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_CONSTRAINT_IDX_CST_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_CONSTRAINT_IDX_CST_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("constraint_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("constraint_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_CONSTRAINT_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_type_idx_db_type_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TYPE_IDX_DB_TYPE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_IDX_DB_TYPE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TYPE_IDX_DB_TYPE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type_name", //column_name + column_id + 18, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TYPE_TID); + + table_schema.set_max_used_column_id(column_id + 18); + return ret; +} + +int ObInnerTableSchema::all_type_idx_type_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TYPE_IDX_TYPE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_IDX_TYPE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TYPE_IDX_TYPE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type_name", //column_name + column_id + 18, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TYPE_TID); + + table_schema.set_max_used_column_id(column_id + 18); + return ret; +} + +int ObInnerTableSchema::all_type_attr_idx_type_attr_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TYPE_ATTR_IDX_TYPE_ATTR_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("name", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("attribute", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TYPE_ATTR_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_coll_type_idx_coll_name_type_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_COLL_TYPE_IDX_COLL_NAME_TYPE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("coll_name", //column_name + column_id + 16, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("coll_type", //column_name + column_id + 13, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("coll_type_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_COLL_TYPE_TID); + + table_schema.set_max_used_column_id(column_id + 16); + return ret; +} + +int ObInnerTableSchema::all_dblink_idx_owner_dblink_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DBLINK_IDX_OWNER_DBLINK_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("owner_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dblink_name", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DBLINK_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dblink_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DBLINK_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_dblink_idx_dblink_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DBLINK_IDX_DBLINK_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBLINK_IDX_DBLINK_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DBLINK_IDX_DBLINK_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dblink_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DBLINK_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dblink_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DBLINK_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_role_grantee_map_idx_grantee_role_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_ROLE_GRANTEE_MAP_IDX_GRANTEE_ROLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("role_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantee_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_role_grantee_map_history_idx_grantee_his_role_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_IDX_GRANTEE_HIS_ROLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("role_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 4, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantee_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_ROLE_GRANTEE_MAP_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_keystore_idx_keystore_master_key_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_KEYSTORE_IDX_KEYSTORE_MASTER_KEY_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("master_key_id", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("keystore_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_KEYSTORE_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_tenant_keystore_history_idx_keystore_his_master_key_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_KEYSTORE_HISTORY_IDX_KEYSTORE_HIS_MASTER_KEY_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("master_key_id", //column_name + column_id + 8, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("keystore_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_KEYSTORE_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 8); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_policy_idx_ols_policy_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("policy_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_POLICY_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_policy_idx_ols_policy_col_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_POLICY_IDX_OLS_POLICY_COL_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_POLICY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_component_idx_ols_com_policy_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_COMPONENT_IDX_OLS_COM_POLICY_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("comp_type", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_component_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_COMPONENT_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_policy_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_POLICY_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_label_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_tag_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TAG_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_tag", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_label_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_label_idx_ols_lab_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_LABEL_IDX_OLS_LAB_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_label_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_LABEL_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_user_level_idx_ols_level_uid_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_UID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_user_level_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_ols_user_level_idx_ols_level_policy_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OLS_USER_LEVEL_IDX_OLS_LEVEL_POLICY_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_policy_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("label_se_user_level_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OLS_USER_LEVEL_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_profile_idx_profile_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_PROFILE_IDX_PROFILE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("profile_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_ORACLE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("profile_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_PROFILE_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_security_audit_idx_audit_type_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_SECURITY_AUDIT_IDX_AUDIT_TYPE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("audit_type", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObUInt64Type, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(uint64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("audit_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_SECURITY_AUDIT_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_trigger_idx_trigger_base_obj_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_BASE_OBJ_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("base_object_id", //column_name + column_id + 11, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); + + table_schema.set_max_used_column_id(column_id + 11); + return ret; +} + +int ObInnerTableSchema::all_tenant_trigger_idx_db_trigger_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_TRIGGER_IDX_DB_TRIGGER_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_name", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TRIGGER_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_trigger_idx_trigger_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_TRIGGER_IDX_TRIGGER_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TRIGGER_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_tenant_trigger_history_idx_trigger_his_base_obj_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_TRIGGER_HISTORY_IDX_TRIGGER_HIS_BASE_OBJ_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("base_object_id", //column_name + column_id + 12, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trigger_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_TRIGGER_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 12); + return ret; +} + +int ObInnerTableSchema::all_tenant_objauth_idx_objauth_grantor_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_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(7); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTOR_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantor_id", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("obj_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("objtype", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("col_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantee_id", //column_name + column_id + 6, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("priv_id", //column_name + column_id + 7, //column_id + 7, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OBJAUTH_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_tenant_objauth_idx_objauth_grantee_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_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(7); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OBJAUTH_IDX_OBJAUTH_GRANTEE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantee_id", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("obj_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("objtype", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("col_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("grantor_id", //column_name + column_id + 5, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("priv_id", //column_name + column_id + 7, //column_id + 7, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OBJAUTH_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_tenant_object_type_idx_obj_type_db_obj_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_DB_OBJ_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 13, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_name", //column_name + column_id + 17, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_type_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type", //column_name + column_id + 3, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OBJECT_TYPE_TID); + + table_schema.set_max_used_column_id(column_id + 17); + return ret; +} + +int ObInnerTableSchema::all_tenant_object_type_idx_obj_type_obj_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_OBJECT_TYPE_IDX_OBJ_TYPE_OBJ_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_name", //column_name + column_id + 17, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_type_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_OBJECT_TYPE_TID); + + table_schema.set_max_used_column_id(column_id + 17); + return ret; +} + +int ObInnerTableSchema::all_tenant_global_transaction_idx_xa_trans_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_GLOBAL_TRANSACTION_IDX_XA_TRANS_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trans_id", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("gtrid", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("bqual", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj format_id_default; + format_id_default.set_int(1); + ADD_COLUMN_SCHEMA_T("format_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + format_id_default, + format_id_default); //default_value + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_GLOBAL_TRANSACTION_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_tenant_dependency_idx_dependency_ref_obj_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_DEPENDENCY_IDX_DEPENDENCY_REF_OBJ_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ref_obj_id", //column_name + column_id + 8, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ref_obj_type", //column_name + column_id + 7, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dep_obj_type", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dep_obj_id", //column_name + column_id + 3, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("dep_order", //column_name + column_id + 4, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_DEPENDENCY_TID); + + table_schema.set_max_used_column_id(column_id + 8); + return ret; +} + +int ObInnerTableSchema::all_ddl_error_message_idx_ddl_error_object_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_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(7); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DDL_ERROR_MESSAGE_IDX_DDL_ERROR_OBJECT_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("target_object_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 5, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_ip", //column_name + column_id + 6, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + MAX_IP_ADDR_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("svr_port", //column_name + column_id + 7, //column_id + 7, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DDL_ERROR_MESSAGE_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_table_stat_history_idx_table_stat_his_savtime_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_STAT_HISTORY_IDX_TABLE_STAT_HIS_SAVTIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("savtime", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("partition_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_STAT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_column_stat_history_idx_column_stat_his_savtime_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_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(5); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_COLUMN_STAT_HISTORY_IDX_COLUMN_STAT_HIS_SAVTIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("savtime", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("partition_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_COLUMN_STAT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_histogram_stat_history_idx_histogram_stat_his_savtime_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_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(6); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_HISTOGRAM_STAT_HISTORY_IDX_HISTOGRAM_STAT_HIS_SAVTIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("savtime", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("partition_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("endpoint_num", //column_name + column_id + 5, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_HISTOGRAM_STAT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_tablet_to_ls_idx_tablet_to_ls_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_LS_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ls_id", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablet_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLET_TO_LS_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_tablet_to_ls_idx_tablet_to_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLET_TO_LS_IDX_TABLET_TO_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablet_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLET_TO_LS_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_pending_transaction_idx_pending_tx_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PENDING_TRANSACTION_IDX_PENDING_TX_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("gtrid", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("bqual", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ObObj format_id_default; + format_id_default.set_int(1); + ADD_COLUMN_SCHEMA_T("format_id", //column_name + column_id + 5, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + format_id_default, + format_id_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("trans_id", //column_name + column_id + 2, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PENDING_TRANSACTION_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_context_idx_ctx_namespace_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_CONTEXT_IDX_CTX_NAMESPACE_TID); + + if (OB_SUCC(ret)) { + ObObj namespace_default; + namespace_default.set_varchar(ObString::make_string("")); + ADD_COLUMN_SCHEMA_T("namespace", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_CONTEXT_STRING_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + namespace_default, + namespace_default); //default_value + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("context_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_CONTEXT_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_plan_baseline_item_idx_spm_item_sql_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_SQL_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sql_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SQL_ID_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObUInt64Type, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(uint64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("plan_hash_value", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObUInt64Type, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(uint64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PLAN_BASELINE_ITEM_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_plan_baseline_item_idx_spm_item_value_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_PLAN_BASELINE_ITEM_IDX_SPM_ITEM_VALUE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("plan_hash_value", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObUInt64Type, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(uint64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObUInt64Type, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(uint64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sql_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SQL_ID_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_PLAN_BASELINE_ITEM_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_tenant_directory_idx_directory_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_DIRECTORY_IDX_DIRECTORY_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("directory_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("directory_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_DIRECTORY_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_job_idx_job_powner_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_JOB_IDX_JOB_POWNER_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_JOB_IDX_JOB_POWNER_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_JOB_IDX_JOB_POWNER_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("powner", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_JOB_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_sequence_object_idx_seq_obj_db_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_DB_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sequence_name", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SEQUENCE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sequence_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SEQUENCE_OBJECT_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_sequence_object_idx_seq_obj_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SEQUENCE_OBJECT_IDX_SEQ_OBJ_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sequence_name", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_SEQUENCE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("sequence_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SEQUENCE_OBJECT_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_recyclebin_idx_recyclebin_ori_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_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)) { + ++column_id; // for gmt_create + } + 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(OB_ALL_RECYCLEBIN_IDX_RECYCLEBIN_ORI_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("original_name", //column_name + column_id + 7, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_ORIGINAL_NANE_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_name", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_OBJECT_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("type", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RECYCLEBIN_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_table_privilege_idx_tb_priv_db_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_DB_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_name", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_PRIVILEGE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_table_privilege_idx_tb_priv_tb_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TABLE_PRIVILEGE_IDX_TB_PRIV_TB_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_name", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_name", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_TABLE_PRIVILEGE_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_database_privilege_idx_db_priv_db_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DATABASE_PRIVILEGE_IDX_DB_PRIV_DB_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DATABASE_PRIVILEGE_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_rls_policy_idx_rls_policy_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_policy_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_POLICY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_rls_policy_idx_rls_policy_group_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_POLICY_IDX_RLS_POLICY_GROUP_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_group_id", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_policy_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_POLICY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_rls_policy_history_idx_rls_policy_his_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_POLICY_HISTORY_IDX_RLS_POLICY_HIS_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_policy_id", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_POLICY_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_rls_group_idx_rls_group_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_GROUP_IDX_RLS_GROUP_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_group_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_GROUP_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_rls_group_history_idx_rls_group_his_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_GROUP_HISTORY_IDX_RLS_GROUP_HIS_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_group_id", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_GROUP_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_rls_context_idx_rls_context_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_CONTEXT_IDX_RLS_CONTEXT_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_context_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_CONTEXT_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_rls_context_history_idx_rls_context_his_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_RLS_CONTEXT_HISTORY_IDX_RLS_CONTEXT_HIS_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("rls_context_id", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_RLS_CONTEXT_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_tenant_snapshot_idx_tenant_snapshot_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TENANT_SNAPSHOT_IDX_TENANT_SNAPSHOT_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("snapshot_name", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + OB_MAX_TENANT_SNAPSHOT_NAME_LENGTH_STORE, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name + column_id + 32768, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false,//is_autoincrement + true,//is_hidden + false);//is_storing_column + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_1", //column_name + column_id + 32769, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false,//is_autoincrement + true,//is_hidden + false);//is_storing_column + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("snapshot_id", //column_name + column_id + 2, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_data_table_id(OB_ALL_TENANT_SNAPSHOT_TID); + + table_schema.set_max_used_column_id(column_id + 32769); + return ret; +} + +int ObInnerTableSchema::all_dbms_lock_allocated_idx_dbms_lock_allocated_lockhandle_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("lockhandle", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("name", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_dbms_lock_allocated_idx_dbms_lock_allocated_expiration_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_DBMS_LOCK_ALLOCATED_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("expiration", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("name", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_DBMS_LOCK_ALLOCATED_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_kv_ttl_task_idx_kv_ttl_task_table_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_KV_TTL_TASK_IDX_KV_TTL_TASK_TABLE_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablet_id", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_KV_TTL_TASK_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_kv_ttl_task_history_idx_kv_ttl_task_history_upd_time_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_KV_TTL_TASK_HISTORY_IDX_KV_TTL_TASK_HISTORY_UPD_TIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_update_time", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tablet_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_KV_TTL_TASK_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_mview_refresh_run_stats_idx_mview_refresh_run_stats_num_mvs_current_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_MVIEW_REFRESH_RUN_STATS_IDX_MVIEW_REFRESH_RUN_STATS_NUM_MVS_CURRENT_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("num_mvs_current", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("refresh_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_RUN_STATS_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_mview_refresh_stats_idx_mview_refresh_stats_end_time_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_END_TIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("end_time", //column_name + column_id + 7, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("refresh_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("mview_id", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("retry_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_STATS_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_mview_refresh_stats_idx_mview_refresh_stats_mview_end_time_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_MVIEW_REFRESH_STATS_IDX_MVIEW_REFRESH_STATS_MVIEW_END_TIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("mview_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("end_time", //column_name + column_id + 7, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("refresh_id", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("retry_id", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_MVIEW_REFRESH_STATS_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_transfer_partition_task_idx_transfer_partition_key_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_TRANSFER_PARTITION_TASK_IDX_TRANSFER_PARTITION_KEY_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_id", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("object_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_WITH_COLUMN_FLAGS("shadow_pk_0", //column_name + column_id + 32768, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false,//is_autoincrement + true,//is_hidden + false);//is_storing_column + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("task_id", //column_name + column_id + 1, //column_id + 0, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_UNIQUE_LOCAL); + table_schema.set_data_table_id(OB_ALL_TRANSFER_PARTITION_TASK_TID); + + table_schema.set_max_used_column_id(column_id + 32768); + return ret; +} + +int ObInnerTableSchema::all_client_to_server_session_info_idx_client_to_server_session_info_client_session_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_IDX_CLIENT_TO_SERVER_SESSION_INFO_CLIENT_SESSION_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("client_session_id", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("server_session_id", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_CLIENT_TO_SERVER_SESSION_INFO_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_column_privilege_idx_column_privilege_name_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_COLUMN_PRIVILEGE_IDX_COLUMN_PRIVILEGE_NAME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("user_id", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("database_name", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 1024, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("table_name", //column_name + column_id + 5, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 1024, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("column_name", //column_name + column_id + 6, //column_id + 4, //rowkey_id + 4, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_BINARY, //column_collation_type + 1024, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("priv_id", //column_name + column_id + 2, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_COLUMN_PRIVILEGE_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_user_proxy_info_idx_user_proxy_info_proxy_user_id_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_USER_PROXY_INFO_IDX_USER_PROXY_INFO_PROXY_USER_ID_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("proxy_user_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("client_user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_USER_PROXY_INFO_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_user_proxy_info_history_idx_user_proxy_info_proxy_user_id_history_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_USER_PROXY_INFO_HISTORY_IDX_USER_PROXY_INFO_PROXY_USER_ID_HISTORY_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("proxy_user_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("client_user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_USER_PROXY_INFO_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_user_proxy_role_info_history_idx_user_proxy_role_info_proxy_user_id_history_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_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(5); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_IDX_USER_PROXY_ROLE_INFO_PROXY_USER_ID_HISTORY_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("tenant_id", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("proxy_user_id", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("client_user_id", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("role_id", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("schema_version", //column_name + column_id + 5, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObIntType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(int64_t), //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_USER_PROXY_ROLE_INFO_HISTORY_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_scheduler_job_run_detail_v2_idx_scheduler_job_run_detail_v2_time_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("time", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job_name", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_scheduler_job_run_detail_v2_idx_scheduler_job_run_detail_v2_job_class_time_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_SYS_TABLEGROUP_ID); + table_schema.set_database_id(OB_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_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)) { + ++column_id; // for gmt_create + } + + if (OB_SUCC(ret)) { + ++column_id; // for gmt_modified + } + 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(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_TID); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job_class", //column_name + column_id + 8, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA_TS("time", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObTimestampType, //column_type + CS_TYPE_INVALID, //column_collation_type + sizeof(ObPreciseDateTime), //column_length + -1, //column_precision + -1, //column_scale + false, //is_nullable + false, //is_autoincrement + false); //is_on_update_for_timestamp + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("job_name", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_INVALID, //column_collation_type + 128, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_SCHEDULER_JOB_RUN_DETAIL_V2_TID); + + table_schema.set_max_used_column_id(column_id + 8); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_data_table_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DATA_TABLE_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DATA_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATA_TABLE_ID", //column_name + column_id + 21, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 21); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_db_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DB_TB_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_DB_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_TB_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_IDX_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_column_real_agent_ora_idx_tb_column_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_TB_COLUMN_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_TB_COLUMN_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_column_real_agent_ora_idx_column_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_COLUMN_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_IDX_COLUMN_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_user_real_agent_ora_idx_ur_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_IDX_UR_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_IDX_UR_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_USER_NAME_LENGTH_STORE, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_USER_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_database_real_agent_ora_idx_db_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_IDX_DB_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_IDX_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DATABASE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tablegroup_real_agent_ora_idx_tg_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_IDX_TG_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_IDX_TG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLEGROUP_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLEGROUP_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLEGROUP_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLEGROUP_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_recyclebin_real_agent_ora_idx_recyclebin_db_type_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_DB_TYPE_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_DB_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE", //column_name + column_id + 3, //column_id + 3, //rowkey_id + 3, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_OBJECT_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_part_real_agent_ora_idx_part_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_IDX_PART_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_IDX_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PART_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PART_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_PART_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_sub_part_real_agent_ora_idx_sub_part_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_IDX_SUB_PART_NAME_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_IDX_SUB_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SUB_PART_NAME", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PART_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SUB_PART_ID", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SUB_PART_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_def_sub_part_real_agent_ora_idx_def_sub_part_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_IDX_DEF_SUB_PART_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_IDX_DEF_SUB_PART_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SUB_PART_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_PARTITION_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SUB_PART_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DEF_SUB_PART_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_child_tid_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_CHILD_TID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_CHILD_TID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CHILD_TABLE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_parent_tid_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_PARENT_TID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_PARENT_TID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PARENT_TABLE_ID", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_foreign_key_real_agent_ora_idx_fk_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_IDX_FK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FOREIGN_KEY_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("FOREIGN_KEY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_FOREIGN_KEY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_synonym_real_agent_ora_idx_db_synonym_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_DB_SYNONYM_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_DB_SYNONYM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SYNONYM_NAME", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SYNONYM_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SYNONYM_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_synonym_real_agent_ora_idx_synonym_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_SYNONYM_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_IDX_SYNONYM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SYNONYM_NAME", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SYNONYM_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SYNONYM_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SYNONYM_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_db_routine_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_DB_ROUTINE_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_DB_ROUTINE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_NAME", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_ROUTINE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_routine_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_NAME", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_ROUTINE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_routine_real_agent_ora_idx_routine_pkg_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_PKG_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_IDX_ROUTINE_PKG_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_routine_param_real_agent_ora_idx_routine_param_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_IDX_ROUTINE_PARAM_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_IDX_ROUTINE_PARAM_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PARAM_NAME", //column_name + column_id + 7, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROUTINE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SEQUENCE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_ROUTINE_PARAM_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_virtual_package_real_agent_ora_idx_db_pkg_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_DB_PKG_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_DB_PKG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PACKAGE_NAME", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_PACKAGE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_package_real_agent_ora_idx_pkg_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_PKG_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_IDX_PKG_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PACKAGE_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_PACKAGE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PACKAGE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_PACKAGE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_constraint_real_agent_ora_idx_cst_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_IDX_CST_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_IDX_CST_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CONSTRAINT_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_CONSTRAINT_NAME_LENGTH_ORACLE, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CONSTRAINT_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_CONSTRAINT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_type_real_agent_ora_idx_db_type_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_DB_TYPE_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_DB_TYPE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE_NAME", //column_name + column_id + 18, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 18); + return ret; +} + +int ObInnerTableSchema::all_virtual_type_real_agent_ora_idx_type_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_TYPE_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_IDX_TYPE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE_NAME", //column_name + column_id + 18, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 18); + return ret; +} + +int ObInnerTableSchema::all_virtual_type_attr_real_agent_ora_idx_type_attr_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_IDX_TYPE_ATTR_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_IDX_TYPE_ATTR_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("NAME", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ATTRIBUTE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TYPE_ATTR_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_virtual_coll_type_real_agent_ora_idx_coll_name_type_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_IDX_COLL_NAME_TYPE_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_IDX_COLL_NAME_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLL_NAME", //column_name + column_id + 16, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLL_TYPE", //column_name + column_id + 13, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLL_TYPE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLL_TYPE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 16); + return ret; +} + +int ObInnerTableSchema::all_virtual_dblink_real_agent_ora_idx_owner_dblink_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_OWNER_DBLINK_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_OWNER_DBLINK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OWNER_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DBLINK_NAME", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DBLINK_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DBLINK_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_dblink_real_agent_ora_idx_dblink_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_DBLINK_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_IDX_DBLINK_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DBLINK_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DBLINK_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DBLINK_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBLINK_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_role_grantee_map_real_agent_ora_idx_grantee_role_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_IDX_GRANTEE_ROLE_ID_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_IDX_GRANTEE_ROLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ROLE_ID", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_ROLE_GRANTEE_MAP_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_keystore_real_agent_ora_idx_keystore_master_key_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_IDX_KEYSTORE_MASTER_KEY_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_IDX_KEYSTORE_MASTER_KEY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("MASTER_KEY_ID", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("KEYSTORE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_KEYSTORE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_policy_real_agent_ora_idx_ols_policy_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("POLICY_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_policy_real_agent_ora_idx_ols_policy_col_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_COL_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_IDX_OLS_POLICY_COL_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_POLICY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_component_real_agent_ora_idx_ols_com_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_IDX_OLS_COM_POLICY_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_IDX_OLS_COM_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COMP_TYPE", //column_name + column_id + 4, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_COMPONENT_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_COMPONENT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_POLICY_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_tag_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_TAG_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_TAG_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_TAG", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_label_real_agent_ora_idx_ols_lab_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_IDX_OLS_LAB_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_COLUMN_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_LABEL_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_LABEL_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_user_level_real_agent_ora_idx_ols_level_uid_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_UID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_UID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_USER_LEVEL_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_ols_user_level_real_agent_ora_idx_ols_level_policy_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_POLICY_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_IDX_OLS_LEVEL_POLICY_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_POLICY_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LABEL_SE_USER_LEVEL_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OLS_USER_LEVEL_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_profile_real_agent_ora_idx_profile_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_IDX_PROFILE_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_IDX_PROFILE_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PROFILE_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + MAX_ORACLE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PROFILE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_PROFILE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_security_audit_real_agent_ora_idx_audit_type_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_IDX_AUDIT_TYPE_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_IDX_AUDIT_TYPE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("AUDIT_TYPE", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("AUDIT_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_SECURITY_AUDIT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_trigger_base_obj_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_BASE_OBJ_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_BASE_OBJ_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("BASE_OBJECT_ID", //column_name + column_id + 11, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 11); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_db_trigger_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_DB_TRIGGER_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_DB_TRIGGER_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRIGGER_NAME", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TRIGGER_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_trigger_real_agent_ora_idx_trigger_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_IDX_TRIGGER_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRIGGER_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TRIGGER_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TRIGGER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_TRIGGER_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_objauth_real_agent_ora_idx_objauth_grantor_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTOR_REAL_AGENT_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(7); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTOR_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("GRANTOR_ID", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJ_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJTYPE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COL_ID", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name + column_id + 6, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PRIV_ID", //column_name + column_id + 7, //column_id + 7, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_objauth_real_agent_ora_idx_objauth_grantee_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTEE_REAL_AGENT_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(7); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_IDX_OBJAUTH_GRANTEE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("GRANTEE_ID", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJ_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJTYPE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COL_ID", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("GRANTOR_ID", //column_name + column_id + 5, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PRIV_ID", //column_name + column_id + 7, //column_id + 7, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJAUTH_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_object_type_real_agent_ora_idx_obj_type_db_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_DB_OBJ_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_DB_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 13, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name + column_id + 17, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_TYPE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE", //column_name + column_id + 3, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 17); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_object_type_real_agent_ora_idx_obj_type_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_OBJ_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_IDX_OBJ_TYPE_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name + column_id + 17, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_TABLE_TYPE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_TYPE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_OBJECT_TYPE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 17); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_dependency_real_agent_ora_idx_dependency_ref_obj_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_IDX_DEPENDENCY_REF_OBJ_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_IDX_DEPENDENCY_REF_OBJ_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("REF_OBJ_ID", //column_name + column_id + 8, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("REF_OBJ_TYPE", //column_name + column_id + 7, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DEP_OBJ_TYPE", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DEP_OBJ_ID", //column_name + column_id + 3, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DEP_ORDER", //column_name + column_id + 4, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_DEPENDENCY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 8); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_stat_history_real_agent_ora_idx_table_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_IDX_TABLE_STAT_HIS_SAVTIME_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_IDX_TABLE_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SAVTIME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_STAT_HISTORY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_column_stat_history_real_agent_ora_idx_column_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_IDX_COLUMN_STAT_HIS_SAVTIME_REAL_AGENT_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(5); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_IDX_COLUMN_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SAVTIME", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_COLUMN_STAT_HISTORY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_histogram_stat_history_real_agent_ora_idx_histogram_stat_his_savtime_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_IDX_HISTOGRAM_STAT_HIS_SAVTIME_REAL_AGENT_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(6); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_IDX_HISTOGRAM_STAT_HIS_SAVTIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SAVTIME", //column_name + column_id + 6, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PARTITION_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("COLUMN_ID", //column_name + column_id + 4, //column_id + 5, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ENDPOINT_NUM", //column_name + column_id + 5, //column_id + 6, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_HISTOGRAM_STAT_HISTORY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 6); + return ret; +} + +int ObInnerTableSchema::all_virtual_tablet_to_ls_real_agent_ora_idx_tablet_to_ls_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_LS_ID_REAL_AGENT_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_LS_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LS_ID", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLET_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_virtual_tablet_to_ls_real_agent_ora_idx_tablet_to_table_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_TABLE_ID_REAL_AGENT_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_IDX_TABLET_TO_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLET_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLET_TO_LS_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_context_real_agent_ora_idx_ctx_namespace_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_IDX_CTX_NAMESPACE_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_IDX_CTX_NAMESPACE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("NAMESPACE", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_CONTEXT_STRING_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CONTEXT_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_CONTEXT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_plan_baseline_item_real_agent_ora_idx_spm_item_sql_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_SQL_ID_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_SQL_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SQL_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SQL_ID_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PLAN_HASH_VALUE", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_plan_baseline_item_real_agent_ora_idx_spm_item_value_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_VALUE_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_IDX_SPM_ITEM_VALUE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PLAN_HASH_VALUE", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SQL_ID", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SQL_ID_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_PLAN_BASELINE_ITEM_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_tenant_directory_real_agent_ora_idx_directory_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_IDX_DIRECTORY_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_IDX_DIRECTORY_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DIRECTORY_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DIRECTORY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TENANT_DIRECTORY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_job_real_agent_ora_idx_job_powner_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_IDX_JOB_POWNER_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_IDX_JOB_POWNER_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("POWNER", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("JOB", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_JOB_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_sequence_object_real_agent_ora_idx_seq_obj_db_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_DB_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SEQUENCE_NAME", //column_name + column_id + 5, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SEQUENCE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SEQUENCE_ID", //column_name + column_id + 2, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_sequence_object_real_agent_ora_idx_seq_obj_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_NAME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_IDX_SEQ_OBJ_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SEQUENCE_NAME", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_SEQUENCE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("SEQUENCE_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SEQUENCE_OBJECT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_recyclebin_real_agent_ora_idx_recyclebin_ori_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_ORI_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_IDX_RECYCLEBIN_ORI_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("ORIGINAL_NAME", //column_name + column_id + 7, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_ORIGINAL_NANE_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("OBJECT_NAME", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_OBJECT_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TYPE", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RECYCLEBIN_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 7); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_privilege_real_agent_ora_idx_tb_priv_db_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_DB_NAME_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name + column_id + 4, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_table_privilege_real_agent_ora_idx_tb_priv_tb_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_TB_NAME_REAL_AGENT_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(4); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_IDX_TB_PRIV_TB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_NAME", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_CORE_TALBE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name + column_id + 3, //column_id + 4, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_TABLE_PRIVILEGE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_database_privilege_real_agent_ora_idx_db_priv_db_name_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_IDX_DB_PRIV_DB_NAME_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_IDX_DB_PRIV_DB_NAME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("DATABASE_NAME", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + OB_MAX_DATABASE_NAME_LENGTH, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("USER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DATABASE_PRIVILEGE_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_rls_policy_real_agent_ora_idx_rls_policy_table_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_TABLE_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("RLS_POLICY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_rls_policy_real_agent_ora_idx_rls_policy_group_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_GROUP_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_IDX_RLS_POLICY_GROUP_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("RLS_GROUP_ID", //column_name + column_id + 5, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("RLS_POLICY_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_POLICY_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 5); + return ret; +} + +int ObInnerTableSchema::all_virtual_rls_group_real_agent_ora_idx_rls_group_table_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_IDX_RLS_GROUP_TABLE_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_IDX_RLS_GROUP_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("RLS_GROUP_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_GROUP_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_rls_context_real_agent_ora_idx_rls_context_table_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_IDX_RLS_CONTEXT_TABLE_ID_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_IDX_RLS_CONTEXT_TABLE_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TABLE_ID", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("RLS_CONTEXT_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_RLS_CONTEXT_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_dbms_lock_allocated_real_agent_ora_idx_dbms_lock_allocated_lockhandle_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_REAL_AGENT_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_LOCKHANDLE_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("LOCKHANDLE", //column_name + column_id + 3, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("NAME", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_dbms_lock_allocated_real_agent_ora_idx_dbms_lock_allocated_expiration_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_REAL_AGENT_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(1); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_IDX_DBMS_LOCK_ALLOCATED_EXPIRATION_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("EXPIRATION", //column_name + column_id + 4, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("NAME", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_DBMS_LOCK_ALLOCATED_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 4); + return ret; +} + +int ObInnerTableSchema::all_virtual_user_proxy_info_real_agent_ora_idx_user_proxy_info_proxy_user_id_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_IDX_USER_PROXY_INFO_PROXY_USER_ID_REAL_AGENT_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(3); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_IDX_USER_PROXY_INFO_PROXY_USER_ID_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TENANT_ID", //column_name + column_id + 1, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("PROXY_USER_ID", //column_name + column_id + 3, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("CLIENT_USER_ID", //column_name + column_id + 2, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObNumberType, //column_type + CS_TYPE_INVALID, //column_collation_type + 38, //column_length + 38, //column_precision + 0, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_USER_PROXY_INFO_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 3); + return ret; +} + +int ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_idx_scheduler_job_run_detail_v2_time_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_TIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TIME", //column_name + column_id + 2, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("JOB_NAME", //column_name + column_id + 1, //column_id + 2, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 2); + return ret; +} + +int ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_idx_scheduler_job_run_detail_v2_job_class_time_real_agent_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_ORA_SYS_DATABASE_ID); + table_schema.set_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_REAL_AGENT_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(2); + table_schema.set_load_type(TABLE_LOAD_TYPE_IN_DISK); + table_schema.set_table_type(USER_INDEX); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL); + + if (OB_SUCC(ret)) { + if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_IDX_SCHEDULER_JOB_RUN_DETAIL_V2_JOB_CLASS_TIME_REAL_AGENT_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(ObCollationType::CS_TYPE_UTF8MB4_BIN); + 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); + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("JOB_CLASS", //column_name + column_id + 8, //column_id + 1, //rowkey_id + 1, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + true,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("TIME", //column_name + column_id + 2, //column_id + 2, //rowkey_id + 2, //index_id + 0, //part_key_pos + ObTimestampLTZType, //column_type + CS_TYPE_INVALID, //column_collation_type + 0, //column_length + -1, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + + if (OB_SUCC(ret)) { + ADD_COLUMN_SCHEMA("JOB_NAME", //column_name + column_id + 1, //column_id + 3, //rowkey_id + 0, //index_id + 0, //part_key_pos + ObVarcharType, //column_type + CS_TYPE_UTF8MB4_BIN, //column_collation_type + 128, //column_length + 2, //column_precision + -1, //column_scale + false,//is_nullable + false); //is_autoincrement + } + table_schema.set_index_status(INDEX_STATUS_AVAILABLE); + table_schema.set_index_type(INDEX_TYPE_NORMAL_LOCAL); + table_schema.set_data_table_id(OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID); + + table_schema.set_max_used_column_id(column_id + 8); + 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 60f945002..8570c5367 100644 --- a/src/share/inner_table/ob_inner_table_schema.h +++ b/src/share/inner_table/ob_inner_table_schema.h @@ -1090,6 +1090,7 @@ public: static int all_virtual_nic_info_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_scheduler_job_run_detail_v2_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_spatial_reference_systems_schema(share::schema::ObTableSchema &table_schema); + static int all_virtual_temp_file_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_sql_audit_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_plan_stat_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_plan_cache_plan_explain_ora_schema(share::schema::ObTableSchema &table_schema); @@ -1366,6 +1367,7 @@ public: static int all_virtual_nic_info_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_scheduler_job_run_detail_v2_real_agent_ora_schema(share::schema::ObTableSchema &table_schema); static int all_virtual_spatial_reference_systems_real_agent_ora_schema(share::schema::ObTableSchema &table_schema); + static int all_virtual_temp_file_ora_schema(share::schema::ObTableSchema &table_schema); static int gv_ob_plan_cache_stat_schema(share::schema::ObTableSchema &table_schema); static int gv_ob_plan_cache_plan_stat_schema(share::schema::ObTableSchema &table_schema); static int schemata_schema(share::schema::ObTableSchema &table_schema); @@ -1826,6 +1828,8 @@ public: 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_ob_temp_files_schema(share::schema::ObTableSchema &table_schema); + static int cdb_ob_temp_files_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); @@ -2293,6 +2297,7 @@ public: static int gv_ob_nic_info_ora_schema(share::schema::ObTableSchema &table_schema); static int v_ob_nic_info_ora_schema(share::schema::ObTableSchema &table_schema); static int dba_ob_spatial_columns_ora_schema(share::schema::ObTableSchema &table_schema); + static int dba_ob_temp_files_ora_schema(share::schema::ObTableSchema &table_schema); static int all_table_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_column_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); static int all_ddl_operation_aux_lob_meta_schema(share::schema::ObTableSchema &table_schema); @@ -3883,6 +3888,7 @@ const schema_create_func virtual_table_schema_creators [] = { ObInnerTableSchema::all_virtual_nic_info_schema, ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_schema, ObInnerTableSchema::all_virtual_spatial_reference_systems_schema, + ObInnerTableSchema::all_virtual_temp_file_schema, ObInnerTableSchema::all_virtual_ash_all_virtual_ash_i1_schema, ObInnerTableSchema::all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema, ObInnerTableSchema::all_virtual_sql_audit_all_virtual_sql_audit_i1_schema, @@ -4169,6 +4175,7 @@ const schema_create_func virtual_table_schema_creators [] = { ObInnerTableSchema::all_virtual_nic_info_ora_schema, ObInnerTableSchema::all_virtual_scheduler_job_run_detail_v2_real_agent_ora_schema, ObInnerTableSchema::all_virtual_spatial_reference_systems_real_agent_ora_schema, + ObInnerTableSchema::all_virtual_temp_file_ora_schema, ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_data_table_id_real_agent_schema, ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_db_tb_name_real_agent_schema, ObInnerTableSchema::all_virtual_table_real_agent_ora_idx_tb_name_real_agent_schema, @@ -4716,6 +4723,8 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::innodb_sys_fields_schema, ObInnerTableSchema::innodb_sys_foreign_schema, ObInnerTableSchema::innodb_sys_foreign_cols_schema, + ObInnerTableSchema::dba_ob_temp_files_schema, + ObInnerTableSchema::cdb_ob_temp_files_schema, ObInnerTableSchema::dba_synonyms_schema, ObInnerTableSchema::dba_objects_ora_schema, ObInnerTableSchema::all_objects_schema, @@ -5183,6 +5192,7 @@ const schema_create_func sys_view_schema_creators [] = { ObInnerTableSchema::gv_ob_nic_info_ora_schema, ObInnerTableSchema::v_ob_nic_info_ora_schema, ObInnerTableSchema::dba_ob_spatial_columns_ora_schema, + ObInnerTableSchema::dba_ob_temp_files_ora_schema, NULL,}; const schema_create_func core_index_table_schema_creators [] = { @@ -5823,6 +5833,7 @@ const uint64_t tenant_space_tables [] = { OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID, OB_ALL_VIRTUAL_NIC_INFO_TID, + OB_ALL_VIRTUAL_TEMP_FILE_TID, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TID, OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID, @@ -6108,6 +6119,7 @@ const uint64_t tenant_space_tables [] = { OB_ALL_VIRTUAL_NIC_INFO_ORA_TID, OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID, OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TID, + OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID, OB_GV_OB_PLAN_CACHE_STAT_TID, OB_GV_OB_PLAN_CACHE_PLAN_STAT_TID, OB_SCHEMATA_TID, @@ -6446,6 +6458,7 @@ const uint64_t tenant_space_tables [] = { OB_INNODB_SYS_FIELDS_TID, OB_INNODB_SYS_FOREIGN_TID, OB_INNODB_SYS_FOREIGN_COLS_TID, + OB_DBA_OB_TEMP_FILES_TID, OB_DBA_SYNONYMS_TID, OB_DBA_OBJECTS_ORA_TID, OB_ALL_OBJECTS_TID, @@ -6913,6 +6926,7 @@ const uint64_t tenant_space_tables [] = { OB_GV_OB_NIC_INFO_ORA_TID, OB_V_OB_NIC_INFO_ORA_TID, OB_DBA_OB_SPATIAL_COLUMNS_ORA_TID, + OB_DBA_OB_TEMP_FILES_ORA_TID, OB_ALL_TABLE_IDX_DATA_TABLE_ID_TID, OB_ALL_TABLE_IDX_DB_TB_NAME_TID, OB_ALL_TABLE_IDX_TB_NAME_TID, @@ -7799,7 +7813,8 @@ const uint64_t all_ora_mapping_virtual_table_org_tables [] = { OB_ALL_VIRTUAL_SERVICE_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID, - OB_ALL_VIRTUAL_NIC_INFO_TID, }; + OB_ALL_VIRTUAL_NIC_INFO_TID, + OB_ALL_VIRTUAL_TEMP_FILE_TID, }; const uint64_t all_ora_mapping_virtual_tables [] = { OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID , OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID @@ -7949,6 +7964,7 @@ const uint64_t all_ora_mapping_virtual_tables [] = { OB_ALL_VIRTUAL_SQL_AUDIT_O , OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_ORA_TID , OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID , OB_ALL_VIRTUAL_NIC_INFO_ORA_TID +, OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID , }; /* start/end_pos is start/end postition for column with tenant id */ @@ -8478,6 +8494,7 @@ const char* const tenant_space_table_names [] = { OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TNAME, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TNAME, OB_ALL_VIRTUAL_NIC_INFO_TNAME, + OB_ALL_VIRTUAL_TEMP_FILE_TNAME, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TNAME, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TNAME, OB_ALL_VIRTUAL_PLAN_STAT_ORA_TNAME, @@ -8763,6 +8780,7 @@ const char* const tenant_space_table_names [] = { OB_ALL_VIRTUAL_NIC_INFO_ORA_TNAME, OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TNAME, OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TNAME, + OB_ALL_VIRTUAL_TEMP_FILE_ORA_TNAME, OB_GV_OB_PLAN_CACHE_STAT_TNAME, OB_GV_OB_PLAN_CACHE_PLAN_STAT_TNAME, OB_SCHEMATA_TNAME, @@ -9101,6 +9119,7 @@ const char* const tenant_space_table_names [] = { OB_INNODB_SYS_FIELDS_TNAME, OB_INNODB_SYS_FOREIGN_TNAME, OB_INNODB_SYS_FOREIGN_COLS_TNAME, + OB_DBA_OB_TEMP_FILES_TNAME, OB_DBA_SYNONYMS_TNAME, OB_DBA_OBJECTS_ORA_TNAME, OB_ALL_OBJECTS_TNAME, @@ -9568,6 +9587,7 @@ const char* const tenant_space_table_names [] = { OB_GV_OB_NIC_INFO_ORA_TNAME, OB_V_OB_NIC_INFO_ORA_TNAME, OB_DBA_OB_SPATIAL_COLUMNS_ORA_TNAME, + OB_DBA_OB_TEMP_FILES_ORA_TNAME, OB_ALL_TABLE_IDX_DATA_TABLE_ID_TNAME, OB_ALL_TABLE_IDX_DB_TB_NAME_TNAME, OB_ALL_TABLE_IDX_TB_NAME_TNAME, @@ -10463,6 +10483,7 @@ const uint64_t tenant_distributed_vtables [] = { OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID, OB_ALL_VIRTUAL_NIC_INFO_TID, + OB_ALL_VIRTUAL_TEMP_FILE_TID, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID, OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TID, OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID, @@ -10537,7 +10558,8 @@ const uint64_t tenant_distributed_vtables [] = { OB_ALL_VIRTUAL_TRACEPOINT_INFO_ORA_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_ORA_TID, OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID, - OB_ALL_VIRTUAL_NIC_INFO_ORA_TID, }; + OB_ALL_VIRTUAL_NIC_INFO_ORA_TID, + OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID, }; const uint64_t restrict_access_virtual_tables[] = { OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID, @@ -13280,11 +13302,11 @@ 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 = 300; -const int64_t OB_VIRTUAL_TABLE_COUNT = 829; -const int64_t OB_SYS_VIEW_COUNT = 927; -const int64_t OB_SYS_TENANT_TABLE_COUNT = 2061; +const int64_t OB_VIRTUAL_TABLE_COUNT = 831; +const int64_t OB_SYS_VIEW_COUNT = 930; +const int64_t OB_SYS_TENANT_TABLE_COUNT = 2066; const int64_t OB_CORE_SCHEMA_VERSION = 1; -const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2064; +const int64_t OB_BOOTSTRAP_SCHEMA_VERSION = 2069; } // 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 04e062152..f6b56de05 100644 --- a/src/share/inner_table/ob_inner_table_schema_constants.h +++ b/src/share/inner_table/ob_inner_table_schema_constants.h @@ -790,6 +790,7 @@ const uint64_t OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TID = 12482; // "__al const uint64_t OB_ALL_VIRTUAL_NIC_INFO_TID = 12487; // "__all_virtual_nic_info" const uint64_t OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_TID = 12488; // "__all_virtual_scheduler_job_run_detail_v2" const uint64_t OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_TID = 12490; // "__all_virtual_spatial_reference_systems" +const uint64_t OB_ALL_VIRTUAL_TEMP_FILE_TID = 12505; // "__all_virtual_temp_file" const uint64_t OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TID = 15009; // "ALL_VIRTUAL_SQL_AUDIT_ORA" const uint64_t OB_ALL_VIRTUAL_PLAN_STAT_ORA_TID = 15010; // "ALL_VIRTUAL_PLAN_STAT_ORA" const uint64_t OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TID = 15012; // "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA" @@ -1066,6 +1067,7 @@ const uint64_t OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID = 15451; // " const uint64_t OB_ALL_VIRTUAL_NIC_INFO_ORA_TID = 15456; // "ALL_VIRTUAL_NIC_INFO_ORA" const uint64_t OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TID = 15458; // "ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA" const uint64_t OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TID = 15459; // "ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA" +const uint64_t OB_ALL_VIRTUAL_TEMP_FILE_ORA_TID = 15485; // "ALL_VIRTUAL_TEMP_FILE_ORA" const uint64_t OB_GV_OB_PLAN_CACHE_STAT_TID = 20001; // "GV$OB_PLAN_CACHE_STAT" const uint64_t OB_GV_OB_PLAN_CACHE_PLAN_STAT_TID = 20002; // "GV$OB_PLAN_CACHE_PLAN_STAT" const uint64_t OB_SCHEMATA_TID = 20003; // "SCHEMATA" @@ -1526,6 +1528,8 @@ const uint64_t OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TID = 21590; // "CDB_SCHEDULER_J 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_OB_TEMP_FILES_TID = 21622; // "DBA_OB_TEMP_FILES" +const uint64_t OB_CDB_OB_TEMP_FILES_TID = 21623; // "CDB_OB_TEMP_FILES" 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" @@ -1993,6 +1997,7 @@ const uint64_t OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TID = 28227; // "V$OB_TE const uint64_t OB_GV_OB_NIC_INFO_ORA_TID = 28230; // "GV$OB_NIC_INFO_ORA" const uint64_t OB_V_OB_NIC_INFO_ORA_TID = 28231; // "V$OB_NIC_INFO_ORA" const uint64_t OB_DBA_OB_SPATIAL_COLUMNS_ORA_TID = 28234; // "DBA_OB_SPATIAL_COLUMNS_ORA" +const uint64_t OB_DBA_OB_TEMP_FILES_ORA_TID = 28264; // "DBA_OB_TEMP_FILES_ORA" const uint64_t OB_ALL_TABLE_AUX_LOB_META_TID = 50003; // "__all_table_aux_lob_meta" const uint64_t OB_ALL_COLUMN_AUX_LOB_META_TID = 50004; // "__all_column_aux_lob_meta" const uint64_t OB_ALL_DDL_OPERATION_AUX_LOB_META_TID = 50005; // "__all_ddl_operation_aux_lob_meta" @@ -3567,6 +3572,7 @@ const char *const OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_TNAME = "__all_vir const char *const OB_ALL_VIRTUAL_NIC_INFO_TNAME = "__all_virtual_nic_info"; const char *const OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_TNAME = "__all_virtual_scheduler_job_run_detail_v2"; const char *const OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_TNAME = "__all_virtual_spatial_reference_systems"; +const char *const OB_ALL_VIRTUAL_TEMP_FILE_TNAME = "__all_virtual_temp_file"; const char *const OB_ALL_VIRTUAL_SQL_AUDIT_ORA_TNAME = "ALL_VIRTUAL_SQL_AUDIT"; const char *const OB_ALL_VIRTUAL_PLAN_STAT_ORA_TNAME = "ALL_VIRTUAL_PLAN_STAT"; const char *const OB_ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN_ORA_TNAME = "ALL_VIRTUAL_PLAN_CACHE_PLAN_EXPLAIN"; @@ -3843,6 +3849,7 @@ const char *const OB_ALL_VIRTUAL_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TNAME = "ALL_V const char *const OB_ALL_VIRTUAL_NIC_INFO_ORA_TNAME = "ALL_VIRTUAL_NIC_INFO"; const char *const OB_ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT_ORA_TNAME = "ALL_VIRTUAL_SCHEDULER_JOB_RUN_DETAIL_V2_REAL_AGENT"; const char *const OB_ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT_ORA_TNAME = "ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT"; +const char *const OB_ALL_VIRTUAL_TEMP_FILE_ORA_TNAME = "ALL_VIRTUAL_TEMP_FILE"; const char *const OB_GV_OB_PLAN_CACHE_STAT_TNAME = "GV$OB_PLAN_CACHE_STAT"; const char *const OB_GV_OB_PLAN_CACHE_PLAN_STAT_TNAME = "GV$OB_PLAN_CACHE_PLAN_STAT"; const char *const OB_SCHEMATA_TNAME = "SCHEMATA"; @@ -4303,6 +4310,8 @@ const char *const OB_CDB_SCHEDULER_JOB_RUN_DETAILS_TNAME = "CDB_SCHEDULER_JOB_RU 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_OB_TEMP_FILES_TNAME = "DBA_OB_TEMP_FILES"; +const char *const OB_CDB_OB_TEMP_FILES_TNAME = "CDB_OB_TEMP_FILES"; 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"; @@ -4770,6 +4779,7 @@ const char *const OB_V_OB_TENANT_RESOURCE_LIMIT_DETAIL_ORA_TNAME = "V$OB_TENANT_ const char *const OB_GV_OB_NIC_INFO_ORA_TNAME = "GV$OB_NIC_INFO"; const char *const OB_V_OB_NIC_INFO_ORA_TNAME = "V$OB_NIC_INFO"; const char *const OB_DBA_OB_SPATIAL_COLUMNS_ORA_TNAME = "DBA_OB_SPATIAL_COLUMNS"; +const char *const OB_DBA_OB_TEMP_FILES_ORA_TNAME = "DBA_OB_TEMP_FILES"; const char *const OB_ALL_TABLE_AUX_LOB_META_TNAME = "__all_table_aux_lob_meta"; const char *const OB_ALL_COLUMN_AUX_LOB_META_TNAME = "__all_column_aux_lob_meta"; const char *const OB_ALL_DDL_OPERATION_AUX_LOB_META_TNAME = "__all_ddl_operation_aux_lob_meta"; 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 d4cc29c5a..f79f2b9f6 100644 --- a/src/share/inner_table/ob_inner_table_schema_def.py +++ b/src/share/inner_table/ob_inner_table_schema_def.py @@ -14730,7 +14730,43 @@ def_table_schema(**gen_iterate_virtual_table_def( # 12502: __all_virtual_wr_res_mgr_sysstat # 12503: __all_virtual_kv_redis_table # 12504: __all_virtual_function_io_stat -# 12505: __all_virtual_temp_file + +def_table_schema( + owner = 'wuyuefei.wyf', + table_name = '__all_virtual_temp_file', + table_id = '12505', + table_type = 'VIRTUAL_TABLE', + gm_columns = [], + rowkey_columns = [], + in_tenant_space = True, + + normal_columns = [ + ('tenant_id', 'int'), + ('svr_ip', 'varchar:MAX_IP_ADDR_LENGTH'), + ('svr_port', 'int'), + ('file_id', 'int'), + ('trace_id', 'varchar:OB_MAX_TRACE_ID_BUFFER_SIZE', 'false'), + ('dir_id', 'int'), + ('bytes', 'int'), + ('start_offset', 'int'), + ('is_deleting', 'bool'), + ('cached_page_num', 'int'), + ('write_back_page_num', 'int'), + ('flushed_page_num', 'int'), + ('ref_cnt', 'int'), + ('total_writes', 'int'), + ('unaligned_writes', 'int'), + ('total_reads', 'int'), + ('unaligned_reads', 'int'), + ('total_read_bytes', 'int'), + ('last_access_time', 'timestamp'), + ('last_modify_time', 'timestamp'), + ('birth_time', 'timestamp'), + ], + partition_columns = ['svr_ip', 'svr_port'], + vtable_route_policy = 'distributed', +) + # 余留位置(此行之前占位) # 本区域占位建议:采用真实表名进行占位 ################################################################################ @@ -15238,7 +15274,9 @@ def_table_schema(**no_direct_access(gen_oracle_mapping_real_virtual_table_def('1 # 15482: __all_virtual_res_mgr_sysstat # 15483: __all_virtual_wr_res_mgr_sysstat # 15484: __all_virtual_function_io_stat -# 15485: __all_virtual_temp_file + +def_table_schema(**gen_oracle_mapping_virtual_table_def('15485', all_def_keywords['__all_virtual_temp_file'])) + # 余留位置(此行之前占位) # 本区域定义的Oracle表名比较复杂,一般都采用gen_xxx_table_def()方式定义,占位建议采用基表表名占位 # - 示例:def_table_schema(**no_direct_access(gen_oracle_mapping_virtual_table_def('15009', all_def_keywords['__all_virtual_sql_audit']))) @@ -36427,8 +36465,66 @@ def_table_schema( # 21619: CDB_OB_KV_REDIS_TABLE # 21620: GV$OB_FUNCTION_IO_STAT # 21621: V$OB_FUNCTION_IO_STAT -# 21622: DBA_OB_TEMP_FILES -# 21623: CDB_OB_TEMP_FILES + +def_table_schema( + owner = 'wuyuefei.wyf', + table_name = 'DBA_OB_TEMP_FILES', + table_id = '21622', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """SELECT + SVR_IP, + SVR_PORT, + FILE_ID, + TRACE_ID, + DIR_ID, + BYTES, + START_OFFSET, + TOTAL_WRITES, + UNALIGNED_WRITES, + TOTAL_READS, + UNALIGNED_READS, + TOTAL_READ_BYTES, + LAST_ACCESS_TIME, + LAST_MODIFY_TIME, + BIRTH_TIME + FROM oceanbase.__all_virtual_temp_file + WHERE TENANT_ID = EFFECTIVE_TENANT_ID() +""".replace("\n", " "), +) + +def_table_schema( + owner = 'wuyuefei.wyf', + table_name = 'CDB_OB_TEMP_FILES', + table_id = '21623', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + view_definition = """SELECT + TENANT_ID, + SVR_IP, + SVR_PORT, + FILE_ID, + TRACE_ID, + DIR_ID, + BYTES, + START_OFFSET, + TOTAL_WRITES, + UNALIGNED_WRITES, + TOTAL_READS, + UNALIGNED_READS, + TOTAL_READ_BYTES, + LAST_ACCESS_TIME, + LAST_MODIFY_TIME, + BIRTH_TIME + FROM oceanbase.__all_virtual_temp_file +""".replace("\n", " ") +) + # 余留位置(此行之前占位) # 本区域占位建议:采用真实视图名进行占位 ################################################################################ @@ -64566,7 +64662,39 @@ left join # 28261: DBA_OB_SPM_EVO_RESULT # 28262: GV$OB_FUNCTION_IO_STAT # 28263: V$OB_FUNCTION_IO_STAT -# 28264: DBA_OB_TEMP_FILES + +def_table_schema( + owner = 'wuyuefei.wyf', + table_name = 'DBA_OB_TEMP_FILES', + name_postfix = '_ORA', + database_id = 'OB_ORA_SYS_DATABASE_ID', + table_id = '28264', + table_type = 'SYSTEM_VIEW', + rowkey_columns = [], + normal_columns = [], + gm_columns = [], + in_tenant_space = True, + view_definition = """SELECT + SVR_IP, + SVR_PORT, + FILE_ID, + TRACE_ID, + DIR_ID, + BYTES, + START_OFFSET, + TOTAL_WRITES, + UNALIGNED_WRITES, + TOTAL_READS, + UNALIGNED_READS, + TOTAL_READ_BYTES, + LAST_ACCESS_TIME, + LAST_MODIFY_TIME, + BIRTH_TIME + FROM SYS.ALL_VIRTUAL_TEMP_FILE + WHERE TENANT_ID = EFFECTIVE_TENANT_ID() +""".replace("\n", " "), +) + # 余留位置(此行之前占位) # 本区域占位建议:采用真实视图名进行占位 ################################################################################ diff --git a/src/share/inner_table/table_id_to_name b/src/share/inner_table/table_id_to_name index f558bfc9d..af88010ca 100644 --- a/src/share/inner_table/table_id_to_name +++ b/src/share/inner_table/table_id_to_name @@ -1137,6 +1137,7 @@ # 12488: __all_scheduler_job_run_detail_v2 # BASE_TABLE_NAME # 12490: __all_virtual_spatial_reference_systems # 12490: __all_spatial_reference_systems # BASE_TABLE_NAME +# 12505: __all_virtual_temp_file # 15009: ALL_VIRTUAL_SQL_AUDIT # 15009: __all_virtual_sql_audit # BASE_TABLE_NAME # 15010: ALL_VIRTUAL_PLAN_STAT @@ -1748,6 +1749,8 @@ # 15458: __all_scheduler_job_run_detail_v2 # BASE_TABLE_NAME # 15459: ALL_VIRTUAL_SPATIAL_REFERENCE_SYSTEMS_REAL_AGENT # 15459: __all_spatial_reference_systems # BASE_TABLE_NAME +# 15485: ALL_VIRTUAL_TEMP_FILE +# 15485: __all_virtual_temp_file # BASE_TABLE_NAME # 20001: GV$OB_PLAN_CACHE_STAT # 20002: GV$OB_PLAN_CACHE_PLAN_STAT # 20003: SCHEMATA @@ -2208,6 +2211,8 @@ # 21603: INNODB_SYS_FIELDS # 21604: INNODB_SYS_FOREIGN # 21605: INNODB_SYS_FOREIGN_COLS +# 21622: DBA_OB_TEMP_FILES +# 21623: CDB_OB_TEMP_FILES # 25001: DBA_SYNONYMS # 25002: DBA_OBJECTS # 25003: ALL_OBJECTS @@ -2675,6 +2680,7 @@ # 28230: GV$OB_NIC_INFO # 28231: V$OB_NIC_INFO # 28234: DBA_OB_SPATIAL_COLUMNS +# 28264: DBA_OB_TEMP_FILES # 14999: __idx_11003_all_virtual_plan_cache_stat_i1 # 14999: all_virtual_plan_cache_stat_i1 # INDEX_NAME # 14999: __all_virtual_plan_cache_stat # DATA_BASE_TABLE_NAME diff --git a/src/storage/tmp_file/ob_shared_nothing_tmp_file.cpp b/src/storage/tmp_file/ob_shared_nothing_tmp_file.cpp index 6dbc8fea8..8bd564507 100644 --- a/src/storage/tmp_file/ob_shared_nothing_tmp_file.cpp +++ b/src/storage/tmp_file/ob_shared_nothing_tmp_file.cpp @@ -28,6 +28,74 @@ namespace oceanbase { namespace tmp_file { + +int ObSNTmpFileInfo::init( + const ObCurTraceId::TraceId &trace_id, + const uint64_t tenant_id, + const int64_t dir_id, + const int64_t fd, + const int64_t file_size, + const int64_t truncated_offset, + const bool is_deleting, + const int64_t cached_page_num, + const int64_t write_back_data_page_num, + const int64_t flushed_data_page_num, + const int64_t ref_cnt, + const int64_t write_req_cnt, + const int64_t unaligned_write_req_cnt, + const int64_t read_req_cnt, + const int64_t unaligned_read_req_cnt, + const int64_t total_read_size, + const int64_t last_access_ts, + const int64_t last_modify_ts, + const int64_t birth_ts) +{ + int ret = OB_SUCCESS; + trace_id_ = trace_id; + tenant_id_ = tenant_id; + dir_id_ = dir_id; + fd_ = fd; + file_size_ = file_size; + truncated_offset_ = truncated_offset; + is_deleting_ = is_deleting; + cached_page_num_ = cached_page_num; + write_back_data_page_num_ = write_back_data_page_num; + flushed_data_page_num_ = flushed_data_page_num; + ref_cnt_ = ref_cnt; + write_req_cnt_ = write_req_cnt; + unaligned_write_req_cnt_ = unaligned_write_req_cnt; + read_req_cnt_ = read_req_cnt; + unaligned_read_req_cnt_ = unaligned_read_req_cnt; + total_read_size_ = total_read_size; + last_access_ts_ = last_access_ts; + last_modify_ts_ = last_modify_ts; + birth_ts_ = birth_ts; + return ret; +} + +void ObSNTmpFileInfo::reset() +{ + trace_id_.reset(); + tenant_id_ = OB_INVALID_TENANT_ID; + dir_id_ = ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID; + fd_ = ObTmpFileGlobal::INVALID_TMP_FILE_FD; + file_size_ = 0; + truncated_offset_ = 0; + is_deleting_ = false; + cached_page_num_ = 0; + write_back_data_page_num_ = 0; + flushed_data_page_num_ = 0; + ref_cnt_ = 0; + write_req_cnt_ = 0; + unaligned_write_req_cnt_ = 0; + read_req_cnt_ = 0; + unaligned_read_req_cnt_ = 0; + total_read_size_ = 0; + last_access_ts_ = -1; + last_modify_ts_ = -1; + birth_ts_ = -1; +} + ObTmpFileHandle::ObTmpFileHandle(ObSharedNothingTmpFile *tmp_file) : ptr_(tmp_file) { @@ -188,7 +256,16 @@ ObSharedNothingTmpFile::ObSharedNothingTmpFile() last_page_lock_(common::ObLatchIds::TMP_FILE_LOCK), multi_write_lock_(common::ObLatchIds::TMP_FILE_LOCK), truncate_lock_(common::ObLatchIds::TMP_FILE_LOCK), - inner_flush_ctx_() + inner_flush_ctx_(), + trace_id_(), + write_req_cnt_(0), + unaligned_write_req_cnt_(0), + read_req_cnt_(0), + unaligned_read_req_cnt_(0), + total_read_size_(0), + last_access_ts_(-1), + last_modify_ts_(-1), + birth_ts_(-1) { } @@ -233,6 +310,15 @@ int ObSharedNothingTmpFile::init(const uint64_t tenant_id, const int64_t fd, con tenant_id_ = tenant_id; dir_id_ = dir_id; fd_ = fd; + ObCurTraceId::TraceId *cur_trace_id = ObCurTraceId::get_trace_id(); + if (nullptr != cur_trace_id) { + trace_id_ = *cur_trace_id; + } else { + trace_id_.init(GCONF.self_addr_); + } + last_access_ts_ = ObTimeUtility::current_time(); + last_modify_ts_ = ObTimeUtility::current_time(); + birth_ts_ = ObTimeUtility::current_time(); } LOG_INFO("tmp file init over", KR(ret), K(fd), K(dir_id)); @@ -314,6 +400,17 @@ void ObSharedNothingTmpFile::reset() data_eviction_node_.unlink(); meta_eviction_node_.unlink(); inner_flush_ctx_.reset(); + /******for virtual table begin******/ + trace_id_.reset(); + write_req_cnt_ = 0; + unaligned_write_req_cnt_ = 0; + read_req_cnt_ = 0; + unaligned_read_req_cnt_ = 0; + total_read_size_ = 0; + last_access_ts_ = -1; + last_modify_ts_ = -1; + birth_ts_ = -1; + /******for virtual table end******/ } bool ObSharedNothingTmpFile::is_deleting() @@ -360,6 +457,10 @@ int ObSharedNothingTmpFile::aio_pread(ObTmpFileIOCtx &io_ctx) if (io_ctx.get_read_offset_in_file() < 0) { io_ctx.set_read_offset_in_file(read_offset_); } + if (0 != io_ctx.get_read_offset_in_file() % ObTmpFileGlobal::PAGE_SIZE + || 0 != io_ctx.get_todo_size() % ObTmpFileGlobal::PAGE_SIZE) { + io_ctx.set_is_unaligned_read(true); + } LOG_DEBUG("start to inner read tmp file", K(fd_), K(io_ctx.get_read_offset_in_file()), K(io_ctx.get_todo_size()), K(io_ctx.get_done_size()), KPC(this)); @@ -898,6 +999,8 @@ int ObSharedNothingTmpFile::aio_write(ObTmpFileIOCtx &io_ctx) ret = OB_ERR_UNEXPECTED; LOG_WARN("attempt to write a deleting file", KR(ret), K(fd_)); } else { + bool is_unaligned_write = 0 != file_size_ % ObTmpFileGlobal::PAGE_SIZE + || 0 != io_ctx.get_todo_size() % ObTmpFileGlobal::PAGE_SIZE; while (OB_SUCC(ret) && io_ctx.get_todo_size() > 0) { if (OB_FAIL(inner_write_(io_ctx))) { if (OB_ALLOCATE_TMP_FILE_PAGE_FAILED == ret) { @@ -915,6 +1018,13 @@ int ObSharedNothingTmpFile::aio_write(ObTmpFileIOCtx &io_ctx) } } } // end while + if (OB_SUCC(ret)) { + write_req_cnt_++; + if (is_unaligned_write) { + unaligned_write_req_cnt_++; + } + last_modify_ts_ = ObTimeUtility::current_time(); + } } if (OB_SUCC(ret)) { @@ -1594,6 +1704,7 @@ int ObSharedNothingTmpFile::truncate(const int64_t truncate_offset) LOG_WARN("fail to truncate data page", KR(ret), K(fd_), K(truncate_offset), KPC(this)); } else { truncated_offset_ = truncate_offset; + last_modify_ts_ = ObTimeUtility::current_time(); } } @@ -1816,6 +1927,36 @@ int64_t ObSharedNothingTmpFile::cal_wbp_begin_offset_() const return res; } +void ObSharedNothingTmpFile::set_read_stats_vars(const bool is_unaligned_read, const int64_t read_size) +{ + common::TCRWLock::WLockGuard guard(meta_lock_); + read_req_cnt_++; + if (is_unaligned_read) { + unaligned_read_req_cnt_++; + } + total_read_size_ += read_size; + last_access_ts_ = ObTimeUtility::current_time(); +} + +int ObSharedNothingTmpFile::copy_info_for_virtual_table(ObSNTmpFileInfo &tmp_file_info) +{ + int ret = OB_SUCCESS; + common::TCRWLock::RLockGuardWithTimeout lock_guard(meta_lock_, 100 * 1000L, ret); + if (OB_FAIL(ret)) { + } else if (OB_FAIL(tmp_file_info.init(trace_id_, tenant_id_, + dir_id_, fd_, file_size_, + truncated_offset_, is_deleting_, + cached_page_nums_, write_back_data_page_num_, + flushed_data_page_num_, ref_cnt_, + write_req_cnt_, unaligned_write_req_cnt_, + read_req_cnt_, unaligned_read_req_cnt_, + total_read_size_, last_access_ts_, + last_modify_ts_, birth_ts_))) { + LOG_WARN("fail to init tmp_file_info", KR(ret), KPC(this)); + } + return ret; +}; + int ObSharedNothingTmpFile::remove_flush_node(const bool is_meta) { int ret = OB_SUCCESS; diff --git a/src/storage/tmp_file/ob_shared_nothing_tmp_file.h b/src/storage/tmp_file/ob_shared_nothing_tmp_file.h index 6d6c3414d..dd3ca8bb4 100644 --- a/src/storage/tmp_file/ob_shared_nothing_tmp_file.h +++ b/src/storage/tmp_file/ob_shared_nothing_tmp_file.h @@ -40,6 +40,79 @@ class ObTmpFileFlushManager; class ObTmpFileTreeFlushContext; class ObTmpFileDataFlushContext; +//for virtual table show +class ObSNTmpFileInfo +{ +public: + ObSNTmpFileInfo() : + trace_id_(), + tenant_id_(OB_INVALID_TENANT_ID), + dir_id_(ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID), + fd_(ObTmpFileGlobal::INVALID_TMP_FILE_FD), + file_size_(0), + truncated_offset_(0), + is_deleting_(false), + cached_page_num_(0), + write_back_data_page_num_(0), + flushed_data_page_num_(0), + ref_cnt_(0), + write_req_cnt_(0), + unaligned_write_req_cnt_(0), + read_req_cnt_(0), + unaligned_read_req_cnt_(0), + total_read_size_(0), + last_access_ts_(-1), + last_modify_ts_(-1), + birth_ts_(-1) {} + int init(const ObCurTraceId::TraceId &trace_id, + const uint64_t tenant_id, + const int64_t dir_id, + const int64_t fd, + const int64_t file_size, + const int64_t truncated_offset, + const bool is_deleting, + const int64_t cached_page_num, + const int64_t write_back_data_page_num, + const int64_t flushed_data_page_num, + const int64_t ref_cnt, + const int64_t write_req_cnt, + const int64_t unaligned_write_req_cnt, + const int64_t read_req_cnt, + const int64_t unaligned_read_req_cnt, + const int64_t total_read_size, + const int64_t last_access_ts, + const int64_t last_modify_ts, + const int64_t birth_ts); + void reset(); +public: + common::ObCurTraceId::TraceId trace_id_; + uint64_t tenant_id_; + int64_t dir_id_; + int64_t fd_; + int64_t file_size_; + int64_t truncated_offset_; + bool is_deleting_; + int64_t cached_page_num_; + int64_t write_back_data_page_num_; + int64_t flushed_data_page_num_; + int64_t ref_cnt_; + int64_t write_req_cnt_; + int64_t unaligned_write_req_cnt_; + int64_t read_req_cnt_; + int64_t unaligned_read_req_cnt_; + int64_t total_read_size_; + int64_t last_access_ts_; + int64_t last_modify_ts_; + int64_t birth_ts_; + + TO_STRING_KV(K(trace_id_), K(tenant_id_), K(dir_id_), K(fd_), K(file_size_), + K(truncated_offset_), K(is_deleting_), K(cached_page_num_), + K(write_back_data_page_num_), K(flushed_data_page_num_), + K(ref_cnt_), K(write_req_cnt_), K(unaligned_write_req_cnt_), + K(read_req_cnt_), K(unaligned_read_req_cnt_), K(total_read_size_), + K(last_access_ts_), K(last_modify_ts_), K(birth_ts_)); +}; + class ObSharedNothingTmpFile final { public: @@ -143,7 +216,10 @@ public: KP(meta_flush_node_.get_next()), K(is_in_data_eviction_list_), K(is_in_meta_eviction_list_), KP(data_eviction_node_.get_next()), - KP(meta_eviction_node_.get_next())); + KP(meta_eviction_node_.get_next()), K(trace_id_), + K(write_req_cnt_), K(unaligned_write_req_cnt_), K(read_req_cnt_), + K(unaligned_read_req_cnt_), K(total_read_size_), + K(last_access_ts_), K(last_modify_ts_), K(birth_ts_)); // XXX Currently, K(tmp_file) is used to print the ObSharedNothingTmpFile structure without holding // the file lock. Before adding the print field, make sure it is thread-safe. @@ -209,6 +285,8 @@ public: void get_dirty_meta_page_num(int64_t &non_rightmost_dirty_page_num, int64_t &rightmost_dirty_page_num) const; void get_dirty_meta_page_num_with_lock(int64_t &non_rightmost_dirty_page_num, int64_t &rightmost_dirty_page_num); int64_t cal_wbp_begin_offset(); + void set_read_stats_vars(const bool is_unaligned_read, const int64_t read_size); + int copy_info_for_virtual_table(ObSNTmpFileInfo &tmp_file_info); private: int inner_read_truncated_part_(ObTmpFileIOCtx &io_ctx); @@ -360,6 +438,17 @@ private: ObSpinLock multi_write_lock_; // handle conflicts between multiple writes SpinRWLock truncate_lock_; // handle conflicts between truncate and flushing InnerFlushContext inner_flush_ctx_; // file-level flush context + /********for virtual table begin********/ + common::ObCurTraceId::TraceId trace_id_; + int64_t write_req_cnt_; + int64_t unaligned_write_req_cnt_; + int64_t read_req_cnt_; + int64_t unaligned_read_req_cnt_; + int64_t total_read_size_; + int64_t last_access_ts_; + int64_t last_modify_ts_; + int64_t birth_ts_; + /********for virtual table end********/ }; class ObTmpFileHandle final diff --git a/src/storage/tmp_file/ob_tmp_file_block_manager.cpp b/src/storage/tmp_file/ob_tmp_file_block_manager.cpp index 7fe4d4ada..9c49c617b 100644 --- a/src/storage/tmp_file/ob_tmp_file_block_manager.cpp +++ b/src/storage/tmp_file/ob_tmp_file_block_manager.cpp @@ -546,8 +546,7 @@ ObTmpFileBlockManager::ObTmpFileBlockManager() : block_index_generator_(0), block_map_(), block_allocator_(), - stat_lock_(), - map_lock_() + stat_lock_() {} ObTmpFileBlockManager::~ObTmpFileBlockManager() @@ -613,7 +612,6 @@ int ObTmpFileBlockManager::create_tmp_file_block(const int64_t begin_page_id, co } else if (OB_FAIL(handle.init(blk, this))) { LOG_WARN("fail to init tmp file block handle", KR(ret), K(block_index)); } else { - SharedLockGuard guard(map_lock_); if (OB_FAIL(block_map_.insert(ObTmpFileBlockKey(block_index), handle))) { LOG_WARN("fail to insert tmp file block into map", KR(ret), K(block_index)); } @@ -765,7 +763,6 @@ int ObTmpFileBlockManager::remove_tmp_file_block_(const int64_t block_index) ret = OB_NOT_INIT; LOG_WARN("ObTmpFileBlockManager has not been inited", KR(ret), K(tenant_id_)); } else { - SharedLockGuard guard(map_lock_); if (OB_FAIL(block_map_.erase(ObTmpFileBlockKey(block_index), handle))) { if (ret != OB_ENTRY_NOT_EXIST) { LOG_WARN("fail to erase tmp file block", KR(ret), K(block_index)); @@ -847,7 +844,6 @@ int ObTmpFileBlockManager::get_macro_block_count(int64_t ¯o_block_count) int ObTmpFileBlockManager::get_macro_block_list(common::ObIArray ¯o_id_list) { int ret = OB_SUCCESS; - ExclusiveLockGuard guard(map_lock_); CollectMacroBlockIdFunctor func(macro_id_list); if (IS_NOT_INIT) { ret = OB_NOT_INIT; diff --git a/src/storage/tmp_file/ob_tmp_file_block_manager.h b/src/storage/tmp_file/ob_tmp_file_block_manager.h index 593ec8f9a..927b15b12 100644 --- a/src/storage/tmp_file/ob_tmp_file_block_manager.h +++ b/src/storage/tmp_file/ob_tmp_file_block_manager.h @@ -212,7 +212,6 @@ private: ObTmpFileBlockMap block_map_; common::ObConcurrentFIFOAllocator block_allocator_; common::SpinRWLock stat_lock_; // to protect the consistency of used_page_num_ and physical_block_num_ - common::SpinRWLock map_lock_; // to protect the for_each operation of block_map_ DISALLOW_COPY_AND_ASSIGN(ObTmpFileBlockManager); }; diff --git a/src/storage/tmp_file/ob_tmp_file_io_ctx.cpp b/src/storage/tmp_file/ob_tmp_file_io_ctx.cpp index 0930b1dd3..072dfe0cf 100644 --- a/src/storage/tmp_file/ob_tmp_file_io_ctx.cpp +++ b/src/storage/tmp_file/ob_tmp_file_io_ctx.cpp @@ -33,6 +33,7 @@ ObTmpFileIOCtx::ObTmpFileIOCtx(): read_offset_in_file_(-1), disable_page_cache_(false), disable_block_cache_(false), + is_unaligned_read_(false), io_flag_(), io_timeout_ms_(DEFAULT_IO_WAIT_TIME_MS), io_handles_(), @@ -111,6 +112,7 @@ void ObTmpFileIOCtx::reset() dir_id_ = ObTmpFileGlobal::INVALID_TMP_FILE_DIR_ID; disable_page_cache_ = false; disable_block_cache_ = false; + is_unaligned_read_ = false; io_flag_.reset(); io_timeout_ms_ = DEFAULT_IO_WAIT_TIME_MS; } diff --git a/src/storage/tmp_file/ob_tmp_file_io_ctx.h b/src/storage/tmp_file/ob_tmp_file_io_ctx.h index 6ea971511..d4f17d000 100644 --- a/src/storage/tmp_file/ob_tmp_file_io_ctx.h +++ b/src/storage/tmp_file/ob_tmp_file_io_ctx.h @@ -62,6 +62,8 @@ public: OB_INLINE bool is_disable_block_cache() const { return disable_block_cache_; } OB_INLINE common::ObIOFlag get_io_flag() const { return io_flag_; } OB_INLINE int64_t get_io_timeout_ms() const { return io_timeout_ms_; } + OB_INLINE void set_is_unaligned_read(const bool is_unaligned_read) { is_unaligned_read_ = is_unaligned_read; } + OB_INLINE bool is_unaligned_read() { return is_unaligned_read_; } TO_STRING_KV(K(is_inited_), K(is_read_), K(fd_), K(dir_id_), KP(buf_), @@ -161,6 +163,7 @@ private: int64_t read_offset_in_file_; bool disable_page_cache_; bool disable_block_cache_; // only used in ut, to control whether read data from block cache + bool is_unaligned_read_; //for statistics common::ObIOFlag io_flag_; int64_t io_timeout_ms_; common::ObSEArray io_handles_; diff --git a/src/storage/tmp_file/ob_tmp_file_manager.cpp b/src/storage/tmp_file/ob_tmp_file_manager.cpp index bed07322c..2340346e3 100644 --- a/src/storage/tmp_file/ob_tmp_file_manager.cpp +++ b/src/storage/tmp_file/ob_tmp_file_manager.cpp @@ -307,6 +307,9 @@ int ObTenantTmpFileManager::aio_read(const ObTmpFileIOInfo &io_info, ObTmpFileIO LOG_WARN("fail to init io handle", KR(ret), K(io_info)); } else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) { LOG_WARN("fail to aio pread", KR(ret), K(io_info)); + } else { + tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(), + io_info.size_); } LOG_DEBUG("aio_read a tmp file over", KR(ret), K(io_info), K(io_handle), KPC(tmp_file_handle.get())); @@ -336,6 +339,9 @@ int ObTenantTmpFileManager::aio_pread(const ObTmpFileIOInfo &io_info, LOG_WARN("fail to init io handle", KR(ret), K(io_info)); } else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) { LOG_WARN("fail to aio pread", KR(ret), K(io_info)); + } else { + tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(), + io_info.size_); } LOG_DEBUG("aio_pread a tmp file over", KR(ret), K(io_info), K(offset), K(io_handle), KPC(tmp_file_handle.get())); @@ -363,6 +369,9 @@ int ObTenantTmpFileManager::read(const ObTmpFileIOInfo &io_info, ObTmpFileIOHand LOG_WARN("fail to init io handle", KR(ret), K(io_info)); } else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) { LOG_WARN("fail to aio pread", KR(ret), K(io_info)); + } else { + tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(), + io_info.size_); } if (OB_SUCC(ret) || OB_ITER_END == ret) { @@ -398,6 +407,9 @@ int ObTenantTmpFileManager::pread(const ObTmpFileIOInfo &io_info, const int64_t LOG_WARN("fail to init io handle", KR(ret), K(io_info)); } else if (OB_FAIL(tmp_file_handle.get()->aio_pread(io_handle.get_io_ctx()))) { LOG_WARN("fail to aio pread", KR(ret), K(io_info)); + } else { + tmp_file_handle.get()->set_read_stats_vars(io_handle.get_io_ctx().is_unaligned_read(), + io_info.size_); } if (OB_SUCC(ret) || OB_ITER_END == ret) { @@ -480,7 +492,7 @@ int ObTenantTmpFileManager::get_tmp_file(const int64_t fd, ObTmpFileHandle &file int ret = OB_SUCCESS; if (OB_FAIL(files_.get(ObTmpFileKey(fd), file_handle))) { - if (OB_HASH_NOT_EXIST == ret) { + if (OB_ENTRY_NOT_EXIST == ret) { LOG_WARN("tmp file does not exist", KR(ret), K(fd)); } else { LOG_WARN("fail to get tmp file", KR(ret), K(fd)); @@ -538,5 +550,57 @@ int ObTenantTmpFileManager::get_macro_block_count(int64_t ¯o_block_count) return ret; } +bool ObTenantTmpFileManager::CollectTmpFileKeyFunctor::operator()( + const ObTmpFileKey &key, const ObTmpFileHandle &tmp_file_handle) +{ + int ret = OB_SUCCESS; + ObSharedNothingTmpFile *tmp_file_ptr = NULL; + + if (OB_ISNULL(tmp_file_handle.get())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get invalid tmp file pointer", KR(ret), K(key), KP(tmp_file_handle.get())); + } else if (OB_FAIL(fds_.push_back(key.fd_))) { + LOG_WARN("failed to push back", KR(ret), K(key)); + } + return OB_SUCCESS == ret; +} + +int ObTenantTmpFileManager::get_tmp_file_fds(ObIArray &fd_arr) +{ + int ret = OB_SUCCESS; + CollectTmpFileKeyFunctor func(fd_arr); + if (IS_NOT_INIT) { + ret = OB_NOT_INIT; + LOG_WARN("ObTenantTmpFileManager has not been inited", KR(ret), K(tenant_id_)); + } else if (OB_FAIL(files_.for_each(func))) { + LOG_WARN("fail to collect tmp file fds", KR(ret)); + } + + return ret; +} + +int ObTenantTmpFileManager::get_tmp_file_info(const int64_t fd, ObSNTmpFileInfo &tmp_file_info) +{ + int ret = OB_SUCCESS; + ObTmpFileHandle file_handle; + if (IS_NOT_INIT) { + ret = OB_NOT_INIT; + LOG_WARN("ObTenantTmpFileManager has not been inited", KR(ret), K(tenant_id_)); + } else if (OB_FAIL(get_tmp_file(fd, file_handle))) { + if (OB_ENTRY_NOT_EXIST == ret) { + LOG_INFO("tmp file not exist", KR(ret), K(fd)); + } else { + LOG_WARN("fail to get tmp file", KR(ret), K(fd)); + } + } else if (OB_ISNULL(file_handle.get())) { + ret = OB_ERR_UNEXPECTED; + LOG_WARN("get invalid tmp file pointer", KR(ret), K(fd), KP(file_handle.get())); + } else if (OB_FAIL(file_handle.get()->copy_info_for_virtual_table(tmp_file_info))) { + LOG_WARN("failed to copy info for virtual table", KR(ret), K(fd), KPC(file_handle.get())); + } + + return ret; +} + } // end namespace tmp_file } // end namespace oceanbase diff --git a/src/storage/tmp_file/ob_tmp_file_manager.h b/src/storage/tmp_file/ob_tmp_file_manager.h index 2d9353288..3c794b8e1 100644 --- a/src/storage/tmp_file/ob_tmp_file_manager.h +++ b/src/storage/tmp_file/ob_tmp_file_manager.h @@ -83,6 +83,22 @@ public: OB_INLINE ObTmpFileBlockManager &get_tmp_file_block_manager() { return tmp_file_block_manager_; } OB_INLINE ObTmpFilePageCacheController &get_page_cache_controller() { return page_cache_controller_; } +public: + //for virtual table to show + int get_tmp_file_fds(ObIArray &fd_arr); + int get_tmp_file_info(const int64_t fd, ObSNTmpFileInfo &tmp_file_info); +private: + class CollectTmpFileKeyFunctor final + { + public: + CollectTmpFileKeyFunctor(ObIArray &fds) + : fds_(fds) {} + bool operator()(const ObTmpFileKey &key, const ObTmpFileHandle &tmp_file_handle); + + private: + ObIArray &fds_; + }; + private: static const int64_t REFRESH_CONFIG_INTERVAL = 5 * 60 * 1000 * 1000L; // 5min static const int64_t META_DEFAULT_LIMIT = 15 * 1024L * 1024L * 1024L; diff --git a/tools/deploy/mysql_test/r/mysql/information_schema.result b/tools/deploy/mysql_test/r/mysql/information_schema.result index a712732cd..6ef41f4cf 100644 --- a/tools/deploy/mysql_test/r/mysql/information_schema.result +++ b/tools/deploy/mysql_test/r/mysql/information_schema.result @@ -351,6 +351,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | oceanbase | DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TABLE_STAT_STALE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TASK_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | oceanbase | DBA_OB_TEMP_FILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TENANTS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TENANT_EVENT_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TRANSFER_PARTITION_TASKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -888,6 +889,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | oceanbase | __all_virtual_tablet_meta_table | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tablet_stat | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_task_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | oceanbase | __all_virtual_temp_file | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_event_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_memory_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -1882,6 +1884,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | oceanbase | DBA_OB_TABLE_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TABLE_STAT_STALE_INFO | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TASK_OPT_STAT_GATHER_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | oceanbase | DBA_OB_TEMP_FILES | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TENANTS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TENANT_EVENT_HISTORY | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | DBA_OB_TRANSFER_PARTITION_TASKS | SYSTEM VIEW | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | @@ -2419,6 +2422,7 @@ select * from information_schema.tables where table_schema in ('oceanbase', 'mys | def | oceanbase | __all_virtual_table_mgr | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_table_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_task_opt_stat_gather_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | +| def | oceanbase | __all_virtual_temp_file | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_event_history | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | NULL | NULL | NULL | NULL | NULL | utf8mb4_general_ci | NULL | NULL | | | def | oceanbase | __all_virtual_tenant_memory_info | SYSTEM TABLE | MEMORY | NULL | DYNAMIC | NULL | NULL | NULL | NULL | 0 | 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 84961069d..a935ea56a 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 @@ -6839,6 +6839,26 @@ 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 +desc oceanbase.DBA_OB_TEMP_FILES; +Field Type Null Key Default Extra +SVR_IP varchar(46) NO NULL +SVR_PORT bigint(20) NO NULL +FILE_ID bigint(20) NO NULL +TRACE_ID varchar(64) NO NULL +DIR_ID bigint(20) NO NULL +BYTES bigint(20) NO NULL +START_OFFSET bigint(20) NO NULL +TOTAL_WRITES bigint(20) NO NULL +UNALIGNED_WRITES bigint(20) NO NULL +TOTAL_READS bigint(20) NO NULL +UNALIGNED_READS bigint(20) NO NULL +TOTAL_READ_BYTES bigint(20) NO NULL +LAST_ACCESS_TIME timestamp(6) NO NULL +LAST_MODIFY_TIME timestamp(6) NO NULL +BIRTH_TIME timestamp(6) NO NULL +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.DBA_OB_TEMP_FILES 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 561477619..0d840b986 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 @@ -9682,6 +9682,47 @@ 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 +desc oceanbase.DBA_OB_TEMP_FILES; +Field Type Null Key Default Extra +SVR_IP varchar(46) NO NULL +SVR_PORT bigint(20) NO NULL +FILE_ID bigint(20) NO NULL +TRACE_ID varchar(64) NO NULL +DIR_ID bigint(20) NO NULL +BYTES bigint(20) NO NULL +START_OFFSET bigint(20) NO NULL +TOTAL_WRITES bigint(20) NO NULL +UNALIGNED_WRITES bigint(20) NO NULL +TOTAL_READS bigint(20) NO NULL +UNALIGNED_READS bigint(20) NO NULL +TOTAL_READ_BYTES bigint(20) NO NULL +LAST_ACCESS_TIME timestamp(6) NO NULL +LAST_MODIFY_TIME timestamp(6) NO NULL +BIRTH_TIME timestamp(6) NO NULL +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.DBA_OB_TEMP_FILES limit 1); +cnt +1 +desc oceanbase.CDB_OB_TEMP_FILES; +Field Type Null Key Default Extra +TENANT_ID bigint(20) NO NULL +SVR_IP varchar(46) NO NULL +SVR_PORT bigint(20) NO NULL +FILE_ID bigint(20) NO NULL +TRACE_ID varchar(64) NO NULL +DIR_ID bigint(20) NO NULL +BYTES bigint(20) NO NULL +START_OFFSET bigint(20) NO NULL +TOTAL_WRITES bigint(20) NO NULL +UNALIGNED_WRITES bigint(20) NO NULL +TOTAL_READS bigint(20) NO NULL +UNALIGNED_READS bigint(20) NO NULL +TOTAL_READ_BYTES bigint(20) NO NULL +LAST_ACCESS_TIME timestamp(6) NO NULL +LAST_MODIFY_TIME timestamp(6) NO NULL +BIRTH_TIME timestamp(6) NO NULL +select /*+QUERY_TIMEOUT(60000000)*/ count(*) as cnt from (select * from oceanbase.CDB_OB_TEMP_FILES 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_virtual_table_in_mysql.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result index 354f437c9..714f6df88 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_mysql.result @@ -5039,3 +5039,32 @@ IF(count(*) >= 0, 1, 0) "oceanbase.__all_virtual_nic_info runs in single server" IF(count(*) >= 0, 1, 0) 1 +desc oceanbase.__all_virtual_temp_file; +Field Type Null Key Default Extra +tenant_id bigint(20) NO NULL +svr_ip varchar(46) NO NULL +svr_port bigint(20) NO NULL +file_id bigint(20) NO NULL +trace_id varchar(64) NO NULL +dir_id bigint(20) NO NULL +bytes bigint(20) NO NULL +start_offset bigint(20) NO NULL +is_deleting tinyint(4) NO NULL +cached_page_num bigint(20) NO NULL +write_back_page_num bigint(20) NO NULL +flushed_page_num bigint(20) NO NULL +ref_cnt bigint(20) NO NULL +total_writes bigint(20) NO NULL +unaligned_writes bigint(20) NO NULL +total_reads bigint(20) NO NULL +unaligned_reads bigint(20) NO NULL +total_read_bytes bigint(20) NO NULL +last_access_time timestamp(6) NO NULL +last_modify_time timestamp(6) NO NULL +birth_time timestamp(6) NO NULL +select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_temp_file; +IF(count(*) >= 0, 1, 0) +1 +"oceanbase.__all_virtual_temp_file runs in single server" +IF(count(*) >= 0, 1, 0) +1 diff --git a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result index 509911307..d24a8e582 100644 --- a/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result +++ b/tools/deploy/mysql_test/test_suite/inner_table/r/mysql/desc_virtual_table_in_sys.result @@ -9750,3 +9750,32 @@ description varchar(2048) YES NULL select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_spatial_reference_systems; IF(count(*) >= 0, 1, 0) 1 +desc oceanbase.__all_virtual_temp_file; +Field Type Null Key Default Extra +tenant_id bigint(20) NO NULL +svr_ip varchar(46) NO NULL +svr_port bigint(20) NO NULL +file_id bigint(20) NO NULL +trace_id varchar(64) NO NULL +dir_id bigint(20) NO NULL +bytes bigint(20) NO NULL +start_offset bigint(20) NO NULL +is_deleting tinyint(4) NO NULL +cached_page_num bigint(20) NO NULL +write_back_page_num bigint(20) NO NULL +flushed_page_num bigint(20) NO NULL +ref_cnt bigint(20) NO NULL +total_writes bigint(20) NO NULL +unaligned_writes bigint(20) NO NULL +total_reads bigint(20) NO NULL +unaligned_reads bigint(20) NO NULL +total_read_bytes bigint(20) NO NULL +last_access_time timestamp(6) NO NULL +last_modify_time timestamp(6) NO NULL +birth_time timestamp(6) NO NULL +select /*+QUERY_TIMEOUT(60000000)*/ IF(count(*) >= 0, 1, 0) from oceanbase.__all_virtual_temp_file; +IF(count(*) >= 0, 1, 0) +1 +"oceanbase.__all_virtual_temp_file runs in single server" +IF(count(*) >= 0, 1, 0) +1 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 be310cd82..a2b3714ec 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 @@ -762,6 +762,7 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 12487 __all_virtual_nic_info 2 201001 1 12488 __all_virtual_scheduler_job_run_detail_v2 2 201001 1 12490 __all_virtual_spatial_reference_systems 2 201001 1 +12505 __all_virtual_temp_file 2 201001 1 20001 GV$OB_PLAN_CACHE_STAT 1 201001 1 20002 GV$OB_PLAN_CACHE_PLAN_STAT 1 201001 1 20003 SCHEMATA 1 201002 1 @@ -1222,6 +1223,8 @@ select 0xffffffffff & table_id, table_name, table_type, database_id, part_num fr 21603 INNODB_SYS_FIELDS 1 201002 1 21604 INNODB_SYS_FOREIGN 1 201002 1 21605 INNODB_SYS_FOREIGN_COLS 1 201002 1 +21622 DBA_OB_TEMP_FILES 1 201001 1 +21623 CDB_OB_TEMP_FILES 1 201001 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;