From f1e2fed8ddbb77530cc69c8d753fd313b9e1fa35 Mon Sep 17 00:00:00 2001 From: Sam Tunnicliffe Date: Wed, 17 Dec 2014 15:50:59 -0800 Subject: [PATCH] cqlsh doesn't handle LIST statements correctly. patch by Sam Tunnicliffe; reviewed by Mikhail Stepura for CASSANDRA-8370 --- CHANGES.txt | 1 + bin/cqlsh | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9ec35850a1..ecb592ed58 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.1.3 + * (cqlsh) Fixed the handling of LIST statements (CASSANDRA-8370) * Make sstablescrub check leveled manifest again (CASSANDRA-8432) * Check first/last keys in sstable when giving out positions (CASSANDRA-8458) * Disable mmap on Windows (CASSANDRA-6993) diff --git a/bin/cqlsh b/bin/cqlsh index 250fc06671..033eb37cc9 100755 --- a/bin/cqlsh +++ b/bin/cqlsh @@ -987,8 +987,12 @@ class Shell(cmd.Cmd): self.printerr(traceback.format_exc()) return False - if statement.query_string[:6].lower() == 'select' or statement.query_string.lower().startswith("list"): + if statement.query_string[:6].lower() == 'select': self.print_result(rows, self.parse_for_table_meta(statement.query_string)) + elif statement.query_string.lower().startswith("list users"): + self.print_result(rows, self.get_table_meta('system_auth','users')) + elif statement.query_string.lower().startswith("list"): + self.print_result(rows, self.get_table_meta('system_auth','permissions')) elif rows: # CAS INSERT/UPDATE self.writeresult("")