[
https://issues.apache.org/jira/browse/CASSANDRA-2492?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aaron Morton updated CASSANDRA-2492:
------------------------------------
Attachment: 0001-use-StringEscapeUtils-to-escape-and-unescape.patch
Attached patch to use StringEscapeUtils to escape and unescape cli strings,
includes unit test.
> add an escapeSQLString function and fix unescapeSQLString
> ---------------------------------------------------------
>
> Key: CASSANDRA-2492
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2492
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 0.7.4
> Reporter: Aaron Morton
> Assignee: Aaron Morton
> Priority: Trivial
> Attachments: 0001-use-StringEscapeUtils-to-escape-and-unescape.patch
>
>
> CliUtils.unescapeSqlString repeats the escape character e.g.
> {noformat}"my \\t tab" becomes "my \tt"{noformat}
> because {{i}} is not bumped when an escape is processed.
>
> Also for Cassandra-2221 I need a function to escape strings back so they will
> work if processed by the cli again.
> There are a number of non [standard
> escapes|http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#101089]
> which I assume is a hang over from is original source
> https://github.com/apache/cassandra/blob/1aeca2b6257b0ad6680080b1756edf7ee9acf8c8/src/java/org/apache/cassandra/cli/CliUtils.java
> Will change to use the
> [StringEscapeUtils|http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/StringEscapeUtils.html]
> class
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira