From 46d4f6f3525abe6cdab26ff9e59499fb4d474d4d Mon Sep 17 00:00:00 2001 From: Nadav Har'El Date: Mon, 30 Apr 2018 01:18:55 +0300 Subject: [PATCH] secondary index: fix yet another case sensitivity bug When the secondary index code builds a "%s IS NOT NULL" clause for a CQL statement, it needs to quote the column name if it needs to be (not only lowercase, digits and _). Fixes #3401. Signed-off-by: Nadav Har'El Message-Id: <20180429221857.6248-7-nyh@scylladb.com> --- 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 7e3cd1b7b5..0ab1bd06e6 100644 --- a/index/secondary_index_manager.cc +++ b/index/secondary_index_manager.cc @@ -42,6 +42,7 @@ #include "index/secondary_index_manager.hh" #include "cql3/statements/index_target.hh" +#include "cql3/util.hh" #include "index/target_parser.hh" #include "db/query_context.hh" #include "schema_builder.hh" @@ -117,7 +118,7 @@ view_ptr secondary_index_manager::create_view_for_index(const index_metadata& im } builder.with_column(col.name(), col.type, column_kind::clustering_key); } - const sstring where_clause = sprint("%s IS NOT NULL", index_target_name); + const sstring where_clause = sprint("%s IS NOT NULL", cql3::util::maybe_quote(index_target_name)); builder.with_view_info(*schema, false, where_clause); return view_ptr{builder.build()}; }