diff --git a/CHANGES.txt b/CHANGES.txt index 541f11cb9a..3b5e51fb62 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ * Fix filtering on non-primary key columns for queries without index (CASSANDRA-6377) * Fix sstableloader fail when using materialized view (CASSANDRA-11275) Merged from 2.2: + * (cqlsh) Fix error when result is 0 rows with EXPAND ON (CASSANDRA-11092) * Add missing newline at end of bin/cqlsh (CASSANDRA-11325) * Fix AE in nodetool cfstats (backport CASSANDRA-10859) (CASSANDRA-11297) * Unresolved hostname leads to replace being ignored (CASSANDRA-11210) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 83dbeed6ff..e4ed830958 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -1372,8 +1372,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: