index: use proper local index target when adding index

With global indexes, target column name is always the same as the string
kept in 'options[target]' field. It's not the case for local indexes,
and so a proper extracting function is used to get the value.
This commit is contained in:
Piotr Sarna
2019-02-27 11:23:09 +01:00
parent 2fcae3d0ec
commit 074ed2c8a5

View File

@@ -91,7 +91,8 @@ void secondary_index_manager::reload() {
}
void secondary_index_manager::add_index(const index_metadata& im) {
sstring index_target_name = im.options().at(cql3::statements::index_target::target_option_name);
sstring index_target = im.options().at(cql3::statements::index_target::target_option_name);
sstring index_target_name = target_parser::get_target_column_name_from_string(index_target);
_indices.emplace(im.name(), index{index_target_name, im});
}