You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2013/05/22 01:35:23 UTC

git commit: cqlsh: ninja-fix DROP INDEX autocompletion for CQL3 tables

Updated Branches:
  refs/heads/cassandra-1.2 d8f0ed555 -> 687ac710c


cqlsh: ninja-fix DROP INDEX autocompletion for CQL3 tables


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/687ac710
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/687ac710
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/687ac710

Branch: refs/heads/cassandra-1.2
Commit: 687ac710cc9ec010eab6ff00dd8b6f1a3136c635
Parents: d8f0ed5
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed May 22 02:34:44 2013 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed May 22 02:34:44 2013 +0300

----------------------------------------------------------------------
 bin/cqlsh |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/687ac710/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 974c916..2f6568a 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -669,12 +669,14 @@ class Shell(cmd.Cmd):
         return [c.name for c in self.get_columnfamilies(ksname)]
 
     def get_index_names(self, ksname=None):
-        indnames = []
-        for c in self.get_columnfamilies(ksname):
-            for md in c.column_metadata:
-                if md.index_name is not None:
-                    indnames.append(md.index_name)
-        return indnames
+        cols = []
+        if self.cqlver_atleast(3) and not self.is_cql3_beta():
+            for cfname in self.get_columnfamily_names_cql3(ksname=ksname):
+                cols.extend(self.get_columnfamily_layout(ksname, cfname).columns)
+        else:
+            for cf in self.get_columnfamilies(ksname):
+                cols.extend(cf.column_metadata)
+        return [col.index_name for col in cols if col.index_name is not None]
 
     def filterable_column_names(self, cfdef):
         filterable = set()