From 074ed2c8a55fcdecfce1cf664897f7abfc192cc3 Mon Sep 17 00:00:00 2001 From: Piotr Sarna Date: Wed, 27 Feb 2019 11:23:09 +0100 Subject: [PATCH] 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. --- index/secondary_index_manager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index/secondary_index_manager.cc b/index/secondary_index_manager.cc index 1e640a9001..f1e9a384d1 100644 --- a/index/secondary_index_manager.cc +++ b/index/secondary_index_manager.cc @@ -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}); }