Quote index name in cql string where necessary

This commit is contained in:
Sam Tunnicliffe
2016-10-27 08:32:20 +01:00
parent 9b78c6d86c
commit cb532caed8

View File

@@ -1336,14 +1336,14 @@ class IndexMetadata(object):
index_target = options.pop("target")
if self.kind != "CUSTOM":
return "CREATE INDEX %s ON %s.%s (%s)" % (
self.name, # Cassandra doesn't like quoted index names for some reason
protect_name(self.name),
protect_name(self.keyspace_name),
protect_name(self.table_name),
index_target)
else:
class_name = options.pop("class_name")
ret = "CREATE CUSTOM INDEX %s ON %s.%s (%s) USING '%s'" % (
self.name, # Cassandra doesn't like quoted index names for some reason
protect_name(self.name),
protect_name(self.keyspace_name),
protect_name(self.table_name),
index_target,