提交 3f686262 编写于 作者: T tino247 提交者: ob-robot

[CP] [UPGRADE] Fix oracle virtual index upgrade problem

上级 9bd86a8d
......@@ -19890,19 +19890,24 @@ int ObDDLService::add_table_schema(
share::schema::ObSchemaGetterGuard &schema_guard)
{
int ret = OB_SUCCESS;
int64_t start_time = ObTimeUtility::current_time();
if (OB_FAIL(check_inner_stat())) {
LOG_WARN("variable is not init", KR(ret));
} else if (OB_FAIL(create_table_in_trans(table_schema, NULL, NULL, schema_guard))) {
LOG_WARN("create_table_in_trans failed", KR(ret), K(table_schema));
}
LOG_INFO("[UPGRADE] add inner table", KR(ret), "tenant_id", table_schema.get_tenant_id(),
"table_id", table_schema.get_table_id(), "table_name", table_schema.get_table_name());
LOG_INFO("[UPGRADE] add inner table", KR(ret),
"tenant_id", table_schema.get_tenant_id(),
"table_id", table_schema.get_table_id(),
"table_name", table_schema.get_table_name(),
"cost", ObTimeUtility::current_time() - start_time);
return ret;
}
int ObDDLService::drop_inner_table(const share::schema::ObTableSchema &table_schema)
{
int ret = OB_SUCCESS;
int64_t start_time = ObTimeUtility::current_time();
ObString *stmt = NULL;
ObSchemaGetterGuard schema_guard;
const uint64_t tenant_id = table_schema.get_tenant_id();
......@@ -19931,8 +19936,10 @@ int ObDDLService::drop_inner_table(const share::schema::ObTableSchema &table_sch
NULL, NULL, NULL))) {
LOG_WARN("drop table in transaction failed", KR(ret), K(tenant_id), K(table_id));
}
LOG_INFO("[UPGRADE] drop inner table", KR(ret), K(tenant_id), K(table_id),
"table_name", table_schema.get_table_name());
LOG_INFO("[UPGRADE] drop inner table", KR(ret),
K(tenant_id), K(table_id),
"table_name", table_schema.get_table_name(),
"cost", ObTimeUtility::current_time() - start_time);
return ret;
}
......@@ -1955,26 +1955,12 @@ int ObUpgradeInspection::inner_get_next_row(common::ObNewRow *&row)
} else if (!start_to_read_) {
const ObTableSchema *table_schema = NULL;
const uint64_t table_id = OB_ALL_VIRTUAL_UPGRADE_INSPECTION_TID;
const int64_t col_count = output_column_ids_.count();
ObObj *cells = NULL;
if (OB_FAIL(schema_guard.get_table_schema(OB_SYS_TENANT_ID, table_id, table_schema))) {
LOG_WARN("get_table_schema failed", K(table_id), K(ret));
} else if (NULL == table_schema) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("table_schema is null", KP(table_schema), K(ret));
} else if (0 == col_count) {
// column not specified [eg: count(*)]
} else if (NULL == (cells = static_cast<ObObj *>(
allocator_->alloc(col_count * sizeof(ObObj))))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_ERROR("alloc cells failed", K(col_count), K(ret));
} else {
new (cells)ObObj[col_count];
}
if (OB_SUCC(ret)) {
cur_row_.cells_ = cells;
cur_row_.count_ = col_count;
ObArray<Column> columns;
#define ADD_ROW(name, info) \
......@@ -2005,7 +1991,7 @@ int ObUpgradeInspection::inner_get_next_row(common::ObNewRow *&row)
root_inspection_->is_data_version_passed()));
bool upgrade_job_passed = true;
for (int64_t i = 0; i < UPGRADE_JOB_TYPE_COUNT; i++) {
for (int64_t i = 0; OB_SUCC(ret) && i < UPGRADE_JOB_TYPE_COUNT; i++) {
int tmp = OB_SUCCESS;
ObRsJobType job_type = upgrade_job_type_array[i];
if (job_type > JOB_TYPE_INVALID && job_type < JOB_TYPE_MAX) {
......@@ -2023,10 +2009,6 @@ int ObUpgradeInspection::inner_get_next_row(common::ObNewRow *&row)
#undef CHECK_RESULT
#undef ADD_ROW
if (OB_FAIL(ret)) {
allocator_->free(cells);
cells = NULL;
}
}
if (OB_SUCC(ret)) {
scanner_it_ = scanner_.begin();
......
......@@ -1333,23 +1333,49 @@ int ObAdminUpgradeVirtualSchema::upgrade_(
if (FAILEDx(ctx_.ddl_service_->get_tenant_schema_guard_with_version_in_inner_table(
tenant_id, schema_guard))) {
LOG_WARN("get schema guard in inner table failed", KR(ret), K(tenant_id));
} else if (OB_FAIL(schema_guard.get_table_schema(tenant_id,
table.get_database_id(),
table.get_table_name(),
table.is_index_table(),
exist_schema))) {
LOG_WARN("get table schema failed", KR(ret), K(tenant_id), "table", table.get_table_name());
if (OB_TABLE_NOT_EXIST == ret) {
ret = OB_SUCCESS;
} else {
ObArenaAllocator allocator;
ObString index_name;
if (table.is_index_table()) {
// In the early version, table name of oracle virtual table index is not right
// (data_table_id is mysql virtual table id), which may cause we can't find duplicate index
// with table name and duplicate name conflict occur.
//
// ETC:
// OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ORA_TID = 15034;
// OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ORA_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TID = 19998;
// OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME = "__idx_1099511638779_all_virtual_plan_cache_stat_i1";
// OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ORA_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME = "__idx_1099511642810_all_virtual_plan_cache_stat_i1";
//
// For oracle virtual table index which data_table_id is (1 << 40) | 15034 = 1099511642810,
// but it use OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME as table name.
if (OB_FAIL(table.generate_origin_index_name())) {
LOG_WARN("fail to generate origin index name", KR(ret), K(table));
} else if (OB_FAIL(ObTableSchema::build_index_table_name(
allocator, table.get_data_table_id(),
table.get_origin_index_name_str(), index_name))) {
LOG_WARN("fail to build index table name", KR(ret), K(table));
}
}
if (FAILEDx(schema_guard.get_table_schema(
tenant_id,
table.get_database_id(),
table.is_index_table() ? index_name : table.get_table_name(),
table.is_index_table(),
exist_schema))) {
LOG_WARN("get table schema failed", KR(ret), K(tenant_id), "table", table.get_table_name());
if (OB_TABLE_NOT_EXIST == ret) {
ret = OB_SUCCESS;
}
} else if (OB_ISNULL(exist_schema)) {
// no duplicate table name
} else if (OB_FAIL(ctx_.ddl_service_->drop_inner_table(*exist_schema))) {
LOG_WARN("get table schema failed", KR(ret), K(tenant_id),
"table", table.get_table_name(), "table_id", table.get_table_id());
} else if (OB_FAIL(ctx_.ddl_service_->get_tenant_schema_guard_with_version_in_inner_table(
tenant_id, schema_guard))) {
LOG_WARN("get schema guard in inner table failed", KR(ret), K(tenant_id));
}
} else if (OB_ISNULL(exist_schema)) {
// no duplicate table name
} else if (OB_FAIL(ctx_.ddl_service_->drop_inner_table(*exist_schema))) {
LOG_WARN("get table schema failed", KR(ret), K(tenant_id),
"table", table.get_table_name(), "table_id", table.get_table_id());
} else if (OB_FAIL(ctx_.ddl_service_->get_tenant_schema_guard_with_version_in_inner_table(
tenant_id, schema_guard))) {
LOG_WARN("get schema guard in inner table failed", KR(ret), K(tenant_id));
}
// 2. try drop table first
exist_schema = NULL;
......
......@@ -1773,7 +1773,7 @@ def def_table_schema(**keywords):
add_field(field, database_id)
elif field == 'table_name':
if keywords.has_key('index_name') :
add_char_field(field, table_name2index_tname(keywords['table_name'], keywords['index_name']))
add_char_field(field, table_name2index_tname(keywords['table_name'] + keywords['name_postfix'], keywords['index_name']))
else:
if keywords["name_postfix"] != '_ORA':
add_char_field(field, table_name2tname(keywords['table_name']))
......@@ -2023,12 +2023,14 @@ def generate_h_content():
sys_view_count = 0
print_class_head_h()
new_table_name_postfix_ids = sorted(table_name_postfix_ids, key = lambda table : table[1])
new_index_name_ids = sorted(index_name_ids, key = lambda index : index[1])
h_f.write("\npublic:\n")
method_line = " static int {0}_schema(share::schema::ObTableSchema &table_schema);\n"
for (table_name, table_id) in table_name_postfix_ids:
for (table_name, table_id) in new_table_name_postfix_ids:
h_f.write(method_line.format(table_name.replace('$', '_').lower().strip('_'), table_id))
for line in index_name_ids:
for line in new_index_name_ids:
h_f.write(method_line.format(line[2].replace('$', '_').strip('_').lower()+'_'+line[0].lower(), line[1]))
line = """
private:
......@@ -2050,32 +2052,40 @@ private:
h_f.write(" NULL,};\n\n")
h_f.write("const schema_create_func core_table_schema_creators [] = {\n")
for (table_name, table_id) in table_name_postfix_ids:
for (table_name, table_id) in new_table_name_postfix_ids:
if is_core_table(table_id) and table_id != kv_core_table_id:
h_f.write(method_name.format(table_name.replace('$', '_').lower().strip('_'), table_name))
core_table_count = core_table_count + 1
h_f.write(" NULL,};\n\n")
h_f.write("const schema_create_func sys_table_schema_creators [] = {\n")
for (table_name, table_id) in table_name_postfix_ids:
for (table_name, table_id) in new_table_name_postfix_ids:
if is_sys_table(table_id) and not is_core_table(table_id):
h_f.write(method_name.format(table_name.replace('$', '_').lower().strip('_'), table_name))
sys_table_count = sys_table_count + 1
h_f.write(" NULL,};\n\n")
h_f.write("const schema_create_func virtual_table_schema_creators [] = {\n")
for (table_name, table_id) in table_name_postfix_ids:
if is_virtual_table(table_id):
for (table_name, table_id) in new_table_name_postfix_ids:
if is_mysql_virtual_table(table_id):
h_f.write(method_name.format(table_name.replace('$', '_').lower().strip('_'), table_name))
virtual_table_count = virtual_table_count + 1
for index_l in index_name_ids:
if is_virtual_table(index_l[1]):
for index_l in new_index_name_ids:
if is_mysql_virtual_table(index_l[1]):
h_f.write(method_name.format(index_l[2].replace('$', '_').strip('_').lower()+'_'+index_l[0].lower(), index_l[2]))
virtual_table_count = virtual_table_count + 1
for (table_name, table_id) in new_table_name_postfix_ids:
if is_ora_virtual_table(table_id):
h_f.write(method_name.format(table_name.replace('$', '_').lower().strip('_'), table_name))
virtual_table_count = virtual_table_count + 1
for index_l in new_index_name_ids:
if is_ora_virtual_table(index_l[1]):
h_f.write(method_name.format(index_l[2].replace('$', '_').strip('_').lower()+'_'+index_l[0].lower(), index_l[2]))
virtual_table_count = virtual_table_count + 1
h_f.write(" NULL,};\n\n")
h_f.write("const schema_create_func sys_view_schema_creators [] = {\n")
for (table_name, table_id) in table_name_postfix_ids:
for (table_name, table_id) in new_table_name_postfix_ids:
if is_sys_view(table_id):
h_f.write(method_name.format(table_name.replace('$', '_').lower().strip('_'), table_name))
sys_view_count = sys_view_count + 1
......
......@@ -1539,7 +1539,7 @@ int ObInnerTableSchema::all_virtual_sql_audit_ora_all_virtual_sql_audit_i1_schem
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SQL_AUDIT_ALL_VIRTUAL_SQL_AUDIT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SQL_AUDIT_ORA_ALL_VIRTUAL_SQL_AUDIT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -7049,7 +7049,7 @@ int ObInnerTableSchema::all_virtual_plan_cache_stat_ora_all_virtual_plan_cache_s
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_CACHE_STAT_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_PLAN_CACHE_STAT_ORA_ALL_VIRTUAL_PLAN_CACHE_STAT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -8761,7 +8761,7 @@ int ObInnerTableSchema::all_virtual_session_wait_ora_all_virtual_session_wait_i1
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSION_WAIT_ALL_VIRTUAL_SESSION_WAIT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSION_WAIT_ORA_ALL_VIRTUAL_SESSION_WAIT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -9444,7 +9444,7 @@ int ObInnerTableSchema::all_virtual_session_wait_history_ora_all_virtual_session
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSION_WAIT_HISTORY_ALL_VIRTUAL_SESSION_WAIT_HISTORY_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSION_WAIT_HISTORY_ORA_ALL_VIRTUAL_SESSION_WAIT_HISTORY_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -10793,7 +10793,7 @@ int ObInnerTableSchema::all_virtual_sesstat_ora_all_virtual_sesstat_i1_schema(Ob
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSTAT_ALL_VIRTUAL_SESSTAT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SESSTAT_ORA_ALL_VIRTUAL_SESSTAT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -11165,7 +11165,7 @@ int ObInnerTableSchema::all_virtual_sysstat_ora_all_virtual_sysstat_i1_schema(Ob
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYSSTAT_ALL_VIRTUAL_SYSSTAT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYSSTAT_ORA_ALL_VIRTUAL_SYSSTAT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......@@ -11648,7 +11648,7 @@ int ObInnerTableSchema::all_virtual_system_event_ora_all_virtual_system_event_i1
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYSTEM_EVENT_ALL_VIRTUAL_SYSTEM_EVENT_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SYSTEM_EVENT_ORA_ALL_VIRTUAL_SYSTEM_EVENT_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......
......@@ -684,7 +684,7 @@ int ObInnerTableSchema::all_virtual_sql_plan_monitor_ora_all_virtual_sql_plan_mo
table_schema.set_def_type(TABLE_DEF_TYPE_INTERNAL);
if (OB_SUCC(ret)) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SQL_PLAN_MONITOR_ALL_VIRTUAL_SQL_PLAN_MONITOR_I1_TNAME))) {
if (OB_FAIL(table_schema.set_table_name(OB_ALL_VIRTUAL_SQL_PLAN_MONITOR_ORA_ALL_VIRTUAL_SQL_PLAN_MONITOR_I1_TNAME))) {
LOG_ERROR("fail to set table_name", K(ret));
}
}
......
......@@ -2210,23 +2210,23 @@ public:
static int all_tenant_rewrite_rules_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_reserved_snapshot_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_cluster_event_history_aux_lob_piece_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_cache_stat_all_virtual_plan_cache_stat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_event_all_virtual_session_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_all_virtual_session_wait_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_history_all_virtual_session_wait_history_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_system_event_all_virtual_system_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sesstat_all_virtual_sesstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sysstat_all_virtual_sysstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_all_virtual_sql_audit_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_ora_all_virtual_sql_audit_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_cache_stat_ora_all_virtual_plan_cache_stat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_ora_all_virtual_session_wait_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_history_ora_all_virtual_session_wait_history_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sesstat_ora_all_virtual_sesstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sysstat_ora_all_virtual_sysstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_system_event_ora_all_virtual_system_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_all_virtual_sql_audit_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sysstat_all_virtual_sysstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sesstat_all_virtual_sesstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_system_event_all_virtual_system_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_history_all_virtual_session_wait_history_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_all_virtual_session_wait_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_event_all_virtual_session_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_cache_stat_all_virtual_plan_cache_stat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_plan_monitor_ora_all_virtual_sql_plan_monitor_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_system_event_ora_all_virtual_system_event_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sysstat_ora_all_virtual_sysstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sesstat_ora_all_virtual_sesstat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_history_ora_all_virtual_session_wait_history_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_session_wait_ora_all_virtual_session_wait_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_plan_cache_stat_ora_all_virtual_plan_cache_stat_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_virtual_sql_audit_ora_all_virtual_sql_audit_i1_schema(share::schema::ObTableSchema &table_schema);
static int all_table_idx_data_table_id_schema(share::schema::ObTableSchema &table_schema);
static int all_table_idx_db_tb_name_schema(share::schema::ObTableSchema &table_schema);
static int all_table_idx_tb_name_schema(share::schema::ObTableSchema &table_schema);
......@@ -2925,6 +2925,15 @@ const schema_create_func virtual_table_schema_creators [] = {
ObInnerTableSchema::all_virtual_ls_arb_replica_task_history_schema,
ObInnerTableSchema::all_virtual_archive_dest_status_schema,
ObInnerTableSchema::all_virtual_io_scheduler_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,
ObInnerTableSchema::all_virtual_sysstat_all_virtual_sysstat_i1_schema,
ObInnerTableSchema::all_virtual_sesstat_all_virtual_sesstat_i1_schema,
ObInnerTableSchema::all_virtual_system_event_all_virtual_system_event_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_history_all_virtual_session_wait_history_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_all_virtual_session_wait_i1_schema,
ObInnerTableSchema::all_virtual_session_event_all_virtual_session_event_i1_schema,
ObInnerTableSchema::all_virtual_plan_cache_stat_all_virtual_plan_cache_stat_i1_schema,
ObInnerTableSchema::all_virtual_sql_audit_ora_schema,
ObInnerTableSchema::all_virtual_plan_stat_ora_schema,
ObInnerTableSchema::all_virtual_plan_cache_plan_explain_ora_schema,
......@@ -3135,23 +3144,14 @@ const schema_create_func virtual_table_schema_creators [] = {
ObInnerTableSchema::all_virtual_ls_arb_replica_task_ora_schema,
ObInnerTableSchema::all_virtual_ls_arb_replica_task_history_ora_schema,
ObInnerTableSchema::all_virtual_archive_dest_status_ora_schema,
ObInnerTableSchema::all_virtual_plan_cache_stat_all_virtual_plan_cache_stat_i1_schema,
ObInnerTableSchema::all_virtual_session_event_all_virtual_session_event_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_all_virtual_session_wait_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_history_all_virtual_session_wait_history_i1_schema,
ObInnerTableSchema::all_virtual_system_event_all_virtual_system_event_i1_schema,
ObInnerTableSchema::all_virtual_sesstat_all_virtual_sesstat_i1_schema,
ObInnerTableSchema::all_virtual_sysstat_all_virtual_sysstat_i1_schema,
ObInnerTableSchema::all_virtual_sql_audit_all_virtual_sql_audit_i1_schema,
ObInnerTableSchema::all_virtual_sql_plan_monitor_all_virtual_sql_plan_monitor_i1_schema,
ObInnerTableSchema::all_virtual_sql_audit_ora_all_virtual_sql_audit_i1_schema,
ObInnerTableSchema::all_virtual_plan_cache_stat_ora_all_virtual_plan_cache_stat_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_ora_all_virtual_session_wait_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_history_ora_all_virtual_session_wait_history_i1_schema,
ObInnerTableSchema::all_virtual_sesstat_ora_all_virtual_sesstat_i1_schema,
ObInnerTableSchema::all_virtual_sysstat_ora_all_virtual_sysstat_i1_schema,
ObInnerTableSchema::all_virtual_system_event_ora_all_virtual_system_event_i1_schema,
ObInnerTableSchema::all_virtual_sql_plan_monitor_ora_all_virtual_sql_plan_monitor_i1_schema,
ObInnerTableSchema::all_virtual_system_event_ora_all_virtual_system_event_i1_schema,
ObInnerTableSchema::all_virtual_sysstat_ora_all_virtual_sysstat_i1_schema,
ObInnerTableSchema::all_virtual_sesstat_ora_all_virtual_sesstat_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_history_ora_all_virtual_session_wait_history_i1_schema,
ObInnerTableSchema::all_virtual_session_wait_ora_all_virtual_session_wait_i1_schema,
ObInnerTableSchema::all_virtual_plan_cache_stat_ora_all_virtual_plan_cache_stat_i1_schema,
ObInnerTableSchema::all_virtual_sql_audit_ora_all_virtual_sql_audit_i1_schema,
NULL,};
const schema_create_func sys_view_schema_creators [] = {
......
......@@ -23,7 +23,7 @@ int ObVirtualTableProjector::project_row(const ObIArray<Column> &columns, ObNewR
if (columns.count() < 0) {
ret = OB_INVALID_ARGUMENT;
LOG_WARN("columns is empty", K(ret));
} else if (output_column_ids_.count() != row.count_) {
} else if (output_column_ids_.count() > row.count_) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("column num not match", KR(ret), K(row), K_(output_column_ids));
} else if (OB_ISNULL(row.cells_) && row.count_ != 0) {
......@@ -31,6 +31,7 @@ int ObVirtualTableProjector::project_row(const ObIArray<Column> &columns, ObNewR
LOG_WARN("row count is not valid", KR(ret), K(row));
} else if (OB_ISNULL(row.cells_)) {
// just skip, won't project row
// column not specified, eg: count(*)
} else {
int64_t cell_idx = 0;
FOREACH_CNT_X(column_id, output_column_ids_, OB_SUCCESS == ret) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册