You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by yu...@apache.org on 2016/03/11 23:50:37 UTC

[02/10] cassandra git commit: (cqlsh) Fix error when result is 0 rows with EXPAND ON

(cqlsh) Fix error when result is 0 rows with EXPAND ON

patch by yukim; reviewed by thobbs for CASSANDRA-11092


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

Branch: refs/heads/cassandra-3.0
Commit: 971d6495438f2a344233b5579b9c86c248b7c62c
Parents: c947a2c
Author: Yuki Morishita <yu...@apache.org>
Authored: Fri Mar 11 16:20:33 2016 -0600
Committer: Yuki Morishita <yu...@apache.org>
Committed: Fri Mar 11 16:20:33 2016 -0600

----------------------------------------------------------------------
 CHANGES.txt  | 1 +
 bin/cqlsh.py | 5 +++++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/971d6495/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 87bb0c0..b37ef84 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.6
+ * (cqlsh) Fix error when result is 0 rows with EXPAND ON (CASSANDRA-11092)
  * Fix intra-node serialization issue for multicolumn-restrictions (CASSANDRA-11196)
  * Non-obsoleting compaction operations over compressed files can impose rate limit on normal reads (CASSANDRA-11301)
  * Add missing newline at end of bin/cqlsh (CASSANDRA-11325)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/971d6495/bin/cqlsh.py
----------------------------------------------------------------------
diff --git a/bin/cqlsh.py b/bin/cqlsh.py
index 9082d72..d135317 100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@ -1312,8 +1312,13 @@ class Shell(cmd.Cmd):
     def print_static_result(self, column_names, rows, table_meta):
         if not column_names and not table_meta:
             return
+
         column_names = column_names or table_meta.columns.keys()
         formatted_names = [self.myformat_colname(name, table_meta) for name in column_names]
+        if not rows:
+            # print header only
+            self.print_formatted_result(formatted_names, None)
+            return
         formatted_values = [map(self.myformat_value, row.values()) for row in rows]
 
         if self.expand_enabled: