(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/trunk Commit: 971d6495438f2a344233b5579b9c86c248b7c62c Parents: c947a2c Author: Yuki Morishita <[email protected]> Authored: Fri Mar 11 16:20:33 2016 -0600 Committer: Yuki Morishita <[email protected]> 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:
