Skip to content

Commit

Permalink
(CLI) properly handle quotes in create/update keyspace commands
Browse files Browse the repository at this point in the history
patch by Pavel Yaskevich; reviewed by Jonathan Ellis (CASSANDRA-4129)
  • Loading branch information
xedin committed Apr 6, 2012
1 parent 40515ed commit 17d6354
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
1.0.10
* cqlsh: guess correct version of Python for Arch Linux (CASSANDRA-4090)
* (CLI) properly handle quotes in create/update keyspace commands (CASSANDRA-4129)


1.0.9
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/cli/CliClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ private void executeAddKeySpace(Tree statement)
return;

// first value is the keyspace name, after that it is all key=value
String keyspaceName = statement.getChild(0).getText();
String keyspaceName = CliUtils.unescapeSQLString(statement.getChild(0).getText());
KsDef ksDef = new KsDef(keyspaceName, DEFAULT_PLACEMENT_STRATEGY, new LinkedList<CfDef>());

try
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/apache/cassandra/cli/CliCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ else if (cfDef.name.toUpperCase().equals(cfName.toUpperCase()))

public static String getKeySpace(Tree statement, List<KsDef> keyspaces)
{
return getKeySpace(statement.getChild(0).getText(), keyspaces);
return getKeySpace(CliUtils.unescapeSQLString(statement.getChild(0).getText()), keyspaces);
}

public static String getKeySpace(String ksName, List<KsDef> keyspaces)
Expand Down

0 comments on commit 17d6354

Please sign in to comment.