cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject git commit: fix CLI `show schema` command insert of an extra comma in column_metadata patch by Yuki Morishita; reviewed by Pavel Yaskevich for CASSANDRA-3714
Date Tue, 10 Jan 2012 17:27:48 GMT
Updated Branches:
  refs/heads/cassandra-1.0 f64c17e42 -> 044eb1ede


fix CLI `show schema` command insert of an extra comma in column_metadata
patch by Yuki Morishita; reviewed by Pavel Yaskevich for CASSANDRA-3714


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

Branch: refs/heads/cassandra-1.0
Commit: 044eb1edea40b748ee34c3bb077fdedcc039e38c
Parents: f64c17e
Author: Pavel Yaskevich <povel.y@gmail.com>
Authored: Tue Jan 10 17:38:31 2012 +0000
Committer: Pavel Yaskevich <povel.y@gmail.com>
Committed: Tue Jan 10 17:38:31 2012 +0000

----------------------------------------------------------------------
 CHANGES.txt                                      |    2 ++
 src/java/org/apache/cassandra/cli/CliClient.java |   10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/044eb1ed/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 04a4294..09bb85d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -28,6 +28,8 @@ Merged from 0.8:
    is disabled (CASSANDRA-3696)
  * fix for SelectStatement start/end key are not set correctly
    when a key alias is involved (CASSANDRA-3700)
+ * fix CLI `show schema` command insert of an extra comma in
+   column_metadata (CASSANDRA-3714)
 
 
 1.0.6

http://git-wip-us.apache.org/repos/asf/cassandra/blob/044eb1ed/src/java/org/apache/cassandra/cli/CliClient.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cli/CliClient.java b/src/java/org/apache/cassandra/cli/CliClient.java
index 60ed3ef..c83ba97 100644
--- a/src/java/org/apache/cassandra/cli/CliClient.java
+++ b/src/java/org/apache/cassandra/cli/CliClient.java
@@ -1756,14 +1756,18 @@ public class CliClient
         {
             sb.append("," + NEWLINE);
             sb.append(TAB + TAB + "index_name : '" + CliUtils.escapeSQLString(colDef.index_name)
+ "'," + NEWLINE);
-            sb.append(TAB + TAB + "index_type : " + CliUtils.escapeSQLString(Integer.toString(colDef.index_type.getValue()))
+ "," + NEWLINE);
+            sb.append(TAB + TAB + "index_type : " + CliUtils.escapeSQLString(Integer.toString(colDef.index_type.getValue())));
 
             if (colDef.index_options != null)
             {
-                sb.append(TAB + TAB + "index_options : {"+NEWLINE);        
+                sb.append("," + NEWLINE);
+                sb.append(TAB + TAB + "index_options : {" + NEWLINE);
+                int numOpts = colDef.index_options.size();
                 for (Map.Entry<String, String> entry : colDef.index_options.entrySet())
                 {
-                    sb.append(TAB + TAB + TAB + CliUtils.escapeSQLString(entry.getKey())
+ ": '" + CliUtils.escapeSQLString(entry.getValue()) + "'," + NEWLINE);
+                    sb.append(TAB + TAB + TAB + CliUtils.escapeSQLString(entry.getKey())
+ ": '" + CliUtils.escapeSQLString(entry.getValue()) + "'");
+                    if (--numOpts > 0)
+                        sb.append("," + NEWLINE);
                 }
                 sb.append("}");
             }


Mime
View raw message