From 1c45cdcb3bfbbc28573e7ed00b89e627d33e523b Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Wed, 17 Jun 2015 09:59:28 +0300 Subject: [PATCH] db/legacy_schema_tables: Store column component index Make sure add_column_to_schema_mutation() also sets "column_index" for a column that is stored to system tables. Signed-off-by: Pekka Enberg --- db/legacy_schema_tables.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db/legacy_schema_tables.cc b/db/legacy_schema_tables.cc index d3f2375cfb..630a4d83ee 100644 --- a/db/legacy_schema_tables.cc +++ b/db/legacy_schema_tables.cc @@ -1311,8 +1311,10 @@ std::vector ALL { KEYSPACES, COLUMNFAMILIES, COLUMNS, TRIGGERS, USE auto ckey = clustering_key::from_exploded(*s, {to_bytes(table->cf_name()), column.name()}); m.set_clustered_cell(ckey, "validator", column.type->name(), timestamp); m.set_clustered_cell(ckey, "type", serialize_kind(column.kind), timestamp); + if (!column.is_on_all_components()) { + m.set_clustered_cell(ckey, "component_index", int32_t(column.position()), timestamp); + } #if 0 - adder.add("component_index", column.isOnAllComponents() ? null : column.position()); adder.add("index_name", column.getIndexName()); adder.add("index_type", column.getIndexType() == null ? null : column.getIndexType().toString()); adder.add("index_options", json(column.getIndexOptions()));