Fix unavailable hidden table index after ddl
This commit is contained in:
@ -14313,7 +14313,16 @@ int ObDDLService::rebuild_hidden_table_index(obrpc::ObAlterTableArg &alter_table
|
||||
orig_table_schema,
|
||||
hidden_table_schema))) {
|
||||
LOG_WARN("failed to get orig and hidden table schema", K(ret));
|
||||
} else if (OB_FAIL(col_name_map.init(*orig_table_schema, alter_table_schema))) {
|
||||
} else if (hidden_table_schema->get_simple_index_infos().count() > 0) {
|
||||
// if there is any index in the hidden table, all indexes are already rebuilt because the rebuild is wrap in a transaction
|
||||
const common::ObIArray<ObAuxTableMetaInfo> &index_infos = hidden_table_schema->get_simple_index_infos();
|
||||
for (int64_t i = 0; OB_SUCC(ret) && i < index_infos.count(); ++i) {
|
||||
if (OB_FAIL(index_ids.push_back(index_infos.at(i).table_id_))) {
|
||||
LOG_WARN("push back index id failed", K(ret));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (OB_FAIL(col_name_map.init(*orig_table_schema, alter_table_schema))) {
|
||||
LOG_WARN("failed to init column name map", K(ret), K(alter_table_schema), KPC(orig_table_schema));
|
||||
} else if (OB_FAIL(get_all_dropped_column_ids(alter_table_arg, *orig_table_schema, drop_cols_id_arr))) {
|
||||
LOG_WARN("fail to get drop cols id set", K(ret));
|
||||
@ -14342,6 +14351,7 @@ int ObDDLService::rebuild_hidden_table_index(obrpc::ObAlterTableArg &alter_table
|
||||
LOG_WARN("failed to rebuild hidden table index in trans", K(ret));
|
||||
}
|
||||
}
|
||||
}
|
||||
int tmp_ret = OB_SUCCESS;
|
||||
if (OB_FAIL(ret)) {
|
||||
} else if (OB_SUCCESS != (tmp_ret = publish_schema(tenant_id))) {
|
||||
|
||||
Reference in New Issue
Block a user