cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] git commit: cqlsh: quote single quotes in strings inside collections
Date Sun, 24 Nov 2013 18:56:26 GMT
Updated Branches:
  refs/heads/trunk dc956751f -> f69e043ce


cqlsh: quote single quotes in strings inside collections

patch by Mikhail Stepura; reviewed by Aleksey Yeschenko for
CASSANDRA-6172


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

Branch: refs/heads/trunk
Commit: aec8f16705a4fea6c33e84d5a40d370b99c518e4
Parents: da5ff08
Author: Aleksey Yeschenko <aleksey@apache.org>
Authored: Sun Nov 24 21:51:26 2013 +0300
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Sun Nov 24 21:53:16 2013 +0300

----------------------------------------------------------------------
 CHANGES.txt                  | 1 +
 pylib/cqlshlib/formatting.py | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/aec8f167/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c012148..57c1896 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,6 +2,7 @@
  * Optimize FD phi calculation (CASSANDRA-6386)
  * Improve initial FD phi estimate when starting up (CASSANDRA-6385)
  * Don't list CQL3 table in CLI describe even if named explicitely (CASSANDRA-5750)
+ * cqlsh: quote single quotes in strings inside collections (CASSANDRA-6172)
 
 
 1.2.12

http://git-wip-us.apache.org/repos/asf/cassandra/blob/aec8f167/pylib/cqlshlib/formatting.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/formatting.py b/pylib/cqlshlib/formatting.py
index b571033..44392ce 100644
--- a/pylib/cqlshlib/formatting.py
+++ b/pylib/cqlshlib/formatting.py
@@ -180,6 +180,8 @@ def strftime(time_format, seconds):
 @formatter_for('text')
 def format_value_text(val, encoding, colormap, quote=False, **_):
     escapedval = val.replace(u'\\', u'\\\\')
+    if quote:
+        escapedval = escapedval.replace("'", "''")
     escapedval = unicode_controlchars_re.sub(_show_control_chars, escapedval)
     bval = escapedval.encode(encoding, 'backslashreplace')
     if quote:


Mime
View raw message