You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mi...@apache.org on 2014/08/14 23:33:52 UTC

[2/3] git commit: Fixed the error when tracing query with cqlsh

Fixed the error when tracing query with cqlsh

patch by Robert Stupp; reviewed by Mikhail Stepura for CASSANDRA-7613


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

Branch: refs/heads/trunk
Commit: 91e63d05464b6dfbd1ebfa05449b017e2b8e493a
Parents: a816e09
Author: Robert Stupp <sn...@snazy.de>
Authored: Thu Aug 14 14:24:54 2014 -0700
Committer: Mikhail Stepura <mi...@apache.org>
Committed: Thu Aug 14 14:31:48 2014 -0700

----------------------------------------------------------------------
 CHANGES.txt |  1 +
 bin/cqlsh   | 11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/91e63d05/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fd1f5af..e48117a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.1
+ * (cqlsh) Error when tracing query (CASSANDRA-7613)
  * Avoid IOOBE when building SyntaxError message snippet (CASSANDRA-7569)
  * SSTableExport uses correct validator to create string representation of partition
    keys (CASSANDRA-7498)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/91e63d05/bin/cqlsh
----------------------------------------------------------------------
diff --git a/bin/cqlsh b/bin/cqlsh
index 5b63696..1a2df86 100755
--- a/bin/cqlsh
+++ b/bin/cqlsh
@@ -584,13 +584,14 @@ class Shell(cmd.Cmd):
             self.decoding_errors.append(err)
             return format_value(err, self.output_codec.name, addcolor=self.color)
 
-    def myformat_colname(self, name, cfMetaData):
+    def myformat_colname(self, name, cfMetaData = None):
         column_colors = COLUMN_NAME_COLORS.copy()
         # check column role and color appropriately
-        if name in [col.name for col in cfMetaData.partition_key]:
-            column_colors.default_factory = lambda : RED
-        elif name in [col.name for col in cfMetaData.clustering_key]:
-            column_colors.default_factory = lambda : CYAN
+        if cfMetaData:
+            if name in [col.name for col in cfMetaData.partition_key]:
+                column_colors.default_factory = lambda : RED
+            elif name in [col.name for col in cfMetaData.clustering_key]:
+                column_colors.default_factory = lambda : CYAN
         return self.myformat_value(name, colormap=column_colors)
 
     def report_connection(self):