Fix incorrect cqlsh results when selecting same columns multiple times

Patch by Anthony Grasso; reviewed by Mick Semb Wever for CASSANDRA-13262


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

Branch: refs/heads/trunk
Commit: 62e48c5f3f818d1e841178d7365d208435a63537
Parents: 49adbe7
Author: Mick Semb Wever <m...@apache.org>
Authored: Wed Sep 5 11:13:49 2018 +1000
Committer: Mick Semb Wever <m...@apache.org>
Committed: Wed Sep 5 11:13:49 2018 +1000

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/62e48c5f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f3de388..71c57ea 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.2.14
+ * Fix incorrect cqlsh results when selecting same columns multiple times 
(CASSANDRA-13262)
  * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 
 2.2.13

http://git-wip-us.apache.org/repos/asf/cassandra/blob/62e48c5f/bin/cqlsh.py
----------------------------------------------------------------------
diff --git a/bin/cqlsh.py b/bin/cqlsh.py
index e242d42..3d0e056 100644
--- a/bin/cqlsh.py
+++ b/bin/cqlsh.py
@@ -1313,7 +1313,7 @@ class Shell(cmd.Cmd):
             # print header only
             self.print_formatted_result(formatted_names, None)
             return
-        formatted_values = [map(self.myformat_value, row.values()) for row in 
rows]
+        formatted_values = [map(self.myformat_value, [row[column] for column 
in column_names]) for row in rows]
 
         if self.expand_enabled:
             self.print_formatted_result_vertically(formatted_names, 
formatted_values)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to