Skip to content

Commit b1282f5

Browse files
obdevGarfiled
authored andcommitted
fix rebuild index task invalid data_table_id
Co-authored-by: Garfiled <799044397@qq.com>
1 parent 5735c10 commit b1282f5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/share/ob_ddl_common.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3057,6 +3057,13 @@ int ObDDLUtil::construct_domain_index_arg(const ObTableSchema *table_schema,
30573057
create_index_arg.table_name_ = ObString(table_schema->get_table_name_str());
30583058
create_index_arg.database_name_ = ObString(database_schema->get_database_name_str());
30593059
create_index_arg.tenant_id_ = task.get_tenant_id();
3060+
if (ObDDLType::DDL_REBUILD_INDEX == task.get_task_type()) {
3061+
// Only rebuild-index tasks reuse existing table ids. Offline domain-index
3062+
// rebuild during table/column redefinition still goes through normal
3063+
// create-index schema generation and must leave these ids invalid.
3064+
create_index_arg.data_table_id_ = table_schema->get_table_id();
3065+
create_index_arg.index_table_id_ = index_schema->get_table_id();
3066+
}
30603067
if (index_schema->is_fts_index()) {
30613068
create_index_arg.index_option_.parser_name_ = index_schema->get_parser_name_str();
30623069
create_index_arg.index_key_ = ObDDLResolver::INDEX_KEYNAME::FTS_KEY;

0 commit comments

Comments
 (0)