Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7512E18899 for ; Fri, 11 Mar 2016 22:50:36 +0000 (UTC) Received: (qmail 44563 invoked by uid 500); 11 Mar 2016 22:50:36 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 44517 invoked by uid 500); 11 Mar 2016 22:50:36 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 44490 invoked by uid 99); 11 Mar 2016 22:50:36 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 22:50:36 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 22588DFBDB; Fri, 11 Mar 2016 22:50:36 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yukim@apache.org To: commits@cassandra.apache.org Date: Fri, 11 Mar 2016 22:50:36 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [01/10] cassandra git commit: (cqlsh) Fix error when result is 0 rows with EXPAND ON Repository: cassandra Updated Branches: refs/heads/cassandra-2.2 c947a2c42 -> 971d64954 refs/heads/cassandra-3.0 2d48ddf21 -> 854a243af refs/heads/cassandra-3.5 2257a7a7e -> de44900a3 refs/heads/trunk 8097d390a -> 0ac03a20c (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-2.2 Commit: 971d6495438f2a344233b5579b9c86c248b7c62c Parents: c947a2c Author: Yuki Morishita Authored: Fri Mar 11 16:20:33 2016 -0600 Committer: Yuki Morishita 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: