From aaf201128764cc27905837c1882800c5ae542769 Mon Sep 17 00:00:00 2001 From: Murukesh Mohanan Date: Mon, 13 Mar 2017 14:18:03 +0900 Subject: [PATCH] Fix incorrect cqlsh results when selecting same columns multiple times --- CHANGES.txt | 1 + bin/cqlsh.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 657cb28de3..ed69d14524 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 4.0 + * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262) * Fix WriteResponseHandlerTest is sensitive to test execution order (CASSANDRA-13421) * Improve incremental repair logging (CASSANDRA-13468) * Start compaction when incremental repair finishes (CASSANDRA-13454) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 28e804323e..4e634cac0a 100644 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -1117,7 +1117,7 @@ class Shell(cmd.Cmd): ks_meta = self.conn.metadata.keyspaces.get(ks_name, None) cql_types = [CqlType(cql_typename(t), ks_meta) for t in result.column_types] - formatted_values = [map(self.myformat_value, row.values(), cql_types) for row in result.current_rows] + formatted_values = [map(self.myformat_value, [row[c] for c in column_names], cql_types) for row in result.current_rows] if self.expand_enabled: self.print_formatted_result_vertically(formatted_names, formatted_values)