Fix restore target table/index's encryption key and master key id

This commit is contained in:
Hongqin-Li 2023-10-23 02:10:05 +00:00 committed by ob-robot
parent 5b4c6cac5c
commit edb883dc6c
2 changed files with 6 additions and 0 deletions

View File

@ -15416,7 +15416,10 @@ int ObDDLService::reconstruct_index_schema(obrpc::ObAlterTableArg &alter_table_a
if (is_recover_restore_table) {
if (OB_FAIL(new_index_schema.set_encryption_str(hidden_table_schema.get_encryption_str()))) {
LOG_WARN("set encryption str failed", K(ret), K(hidden_table_schema.get_encryption_str()));
} else if (OB_FAIL(new_index_schema.set_encrypt_key(hidden_table_schema.get_encrypt_key()))) {
LOG_WARN("set encrypt key failed", K(ret), K(hidden_table_schema.get_encrypt_key()));
} else {
new_index_schema.set_master_key_id(hidden_table_schema.get_master_key_id());
new_index_schema.set_tablespace_id(hidden_table_schema.get_tablespace_id());
}
}

View File

@ -772,7 +772,10 @@ int ObImportTableTaskScheduler::construct_import_table_schema_(
LOG_WARN("tablespace must not be null", K(ret), KPC_(import_task));
} else if (OB_FAIL(target_table_schema.set_encryption_str(schema->get_encryption_name()))) {
LOG_WARN("failed to set encryption str", K(ret));
} else if (OB_FAIL(target_table_schema.set_encrypt_key(schema->get_encrypt_key()))) {
LOG_WARN("failed to set encrypt key", K(ret));
} else {
target_table_schema.set_master_key_id(schema->get_master_key_id());
target_table_schema.set_tablespace_id(schema->get_tablespace_id());
}
}