You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2015/06/04 18:40:35 UTC

[1/3] cassandra git commit: cqlsh: Fix using COPY through SOURCE or -f

Repository: cassandra
Updated Branches:
  refs/heads/trunk 96bbb67d3 -> 13ecf33d9


cqlsh: Fix using COPY through SOURCE or -f

Patch by Tyler Hobbs; reviewed by Stefania Alborghetti for
CASSANDRA-9083


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

Branch: refs/heads/trunk
Commit: 5d26943fdabcaa3c11619fea629f086212819f0d
Parents: f1b22df
Author: Tyler Hobbs <ty...@gmail.com>
Authored: Thu Jun 4 11:39:00 2015 -0500
Committer: Tyler Hobbs <ty...@gmail.com>
Committed: Thu Jun 4 11:39:00 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                   |  1 +
 pylib/cqlshlib/cqlhandling.py | 18 +++++++++++++++++-
 pylib/cqlshlib/pylexotron.py  | 12 +++++++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d26943f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index ac3fc53..928eb55 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.6
+ * (cqlsh) Fix using COPY through SOURCE or -f (CASSANDRA-9083)
  * Fix occasional lack of `system` keyspace in schema tables (CASSANDRA-8487)
  * Use ProtocolError code instead of ServerError code for native protocol
    error responses to unsupported protocol versions (CASSANDRA-9451)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d26943f/pylib/cqlshlib/cqlhandling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cqlhandling.py b/pylib/cqlshlib/cqlhandling.py
index 6e61ac1..1836961 100644
--- a/pylib/cqlshlib/cqlhandling.py
+++ b/pylib/cqlshlib/cqlhandling.py
@@ -22,6 +22,7 @@ from . import pylexotron, util
 
 Hint = pylexotron.Hint
 
+
 class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
     keywords = set()
 
@@ -72,9 +73,11 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
     def explain_completion(self, rulename, symname, explanation=None):
         if explanation is None:
             explanation = '<%s>' % (symname,)
+
         @self.completer_for(rulename, symname)
         def explainer(ctxt, cass):
             return [Hint(explanation)]
+
         return explainer
 
     def set_keywords_as_syntax(self):
@@ -96,6 +99,19 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
                 else:
                     # don't put any 'endline' tokens in output
                     continue
+
+            # Convert all unicode tokens to ascii, where possible.  This
+            # helps avoid problems with performing unicode-incompatible
+            # operations on tokens (like .lower()).  See CASSANDRA-9083
+            # for one example of this.
+            str_token = t[1]
+            if isinstance(str_token, unicode):
+                try:
+                    str_token = str_token.encode('ascii')
+                    t = (t[0], str_token) + t[2:]
+                except UnicodeEncodeError:
+                    pass
+
             curstmt.append(t)
             if t[0] == 'endtoken':
                 term_on_nl = False
@@ -191,7 +207,7 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
             # for completion. the opening quote is already there on the command
             # line and not part of the word under completion, and readline
             # fills in the closing quote for us.
-            candidates = [requoter(dequoter(c))[len(prefix)+1:-1] for c in candidates]
+            candidates = [requoter(dequoter(c))[len(prefix) + 1:-1] for c in candidates]
 
             # the above process can result in an empty string; this doesn't help for
             # completions

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5d26943f/pylib/cqlshlib/pylexotron.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/pylexotron.py b/pylib/cqlshlib/pylexotron.py
index b4ac36f..b7558f5 100644
--- a/pylib/cqlshlib/pylexotron.py
+++ b/pylib/cqlshlib/pylexotron.py
@@ -100,7 +100,17 @@ class ParseContext:
             # pretty much just guess
             return ' '.join([t[1] for t in tokens])
         # low end of span for first token, to high end of span for last token
-        return orig[tokens[0][2][0]:tokens[-1][2][1]]
+        orig_text = orig[tokens[0][2][0]:tokens[-1][2][1]]
+
+        # Convert all unicode tokens to ascii, where possible.  This
+        # helps avoid problems with performing unicode-incompatible
+        # operations on tokens (like .lower()).  See CASSANDRA-9083
+        # for one example of this.
+        try:
+            orig_text = orig_text.encode('ascii')
+        except UnicodeEncodeError:
+            pass
+        return orig_text
 
     def __repr__(self):
         return '<%s matched=%r remainder=%r prodname=%r bindings=%r>' \


[2/3] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

Posted by ty...@apache.org.
Merge branch 'cassandra-2.1' into cassandra-2.2

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/trunk
Commit: 24a1a5d71923e723c035eed67bb3a64d658784ec
Parents: d3e00ef 5d26943
Author: Tyler Hobbs <ty...@gmail.com>
Authored: Thu Jun 4 11:40:02 2015 -0500
Committer: Tyler Hobbs <ty...@gmail.com>
Committed: Thu Jun 4 11:40:02 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                   |  1 +
 pylib/cqlshlib/cqlhandling.py | 18 +++++++++++++++++-
 pylib/cqlshlib/pylexotron.py  | 12 +++++++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/24a1a5d7/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index af51a9d,928eb55..9aadeff
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,24 -1,5 +1,25 @@@
 -2.1.6
 +2.2
 + * Add tinyint,smallint,time,date support for UDFs (CASSANDRA-9400)
 + * Deprecates SSTableSimpleWriter and SSTableSimpleUnsortedWriter (CASSANDRA-9546)
 + * Empty INITCOND treated as null in aggregate (CASSANDRA-9457)
 + * Remove use of Cell in Thrift MapReduce classes (CASSANDRA-8609)
 + * Integrate pre-release Java Driver 2.2-rc1, custom build (CASSANDRA-9493)
 + * Clean up gossiper logic for old versions (CASSANDRA-9370)
 + * Fix custom payload coding/decoding to match the spec (CASSANDRA-9515)
 + * ant test-all results incomplete when parsed (CASSANDRA-9463)
 + * Disallow frozen<> types in function arguments and return types for
 +   clarity (CASSANDRA-9411)
 + * Static Analysis to warn on unsafe use of Autocloseable instances (CASSANDRA-9431)
 + * Update commitlog archiving examples now that commitlog segments are
 +   not recycled (CASSANDRA-9350)
 + * Extend Transactional API to sstable lifecycle management (CASSANDRA-8568)
 + * (cqlsh) Add support for native protocol 4 (CASSANDRA-9399)
 + * Ensure that UDF and UDAs are keyspace-isolated (CASSANDRA-9409)
 + * Revert CASSANDRA-7807 (tracing completion client notifications) (CASSANDRA-9429)
 + * Add ability to stop compaction by ID (CASSANDRA-7207)
 + * Let CassandraVersion handle SNAPSHOT version (CASSANDRA-9438)
 +Merged from 2.1:
+  * (cqlsh) Fix using COPY through SOURCE or -f (CASSANDRA-9083)
   * Fix occasional lack of `system` keyspace in schema tables (CASSANDRA-8487)
   * Use ProtocolError code instead of ServerError code for native protocol
     error responses to unsupported protocol versions (CASSANDRA-9451)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/24a1a5d7/pylib/cqlshlib/cqlhandling.py
----------------------------------------------------------------------


[3/3] cassandra git commit: Merge branch 'cassandra-2.2' into trunk

Posted by ty...@apache.org.
Merge branch 'cassandra-2.2' into trunk


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

Branch: refs/heads/trunk
Commit: 13ecf33d9d31f9f906b12a3c7febcf9910be2e10
Parents: 96bbb67 24a1a5d
Author: Tyler Hobbs <ty...@gmail.com>
Authored: Thu Jun 4 11:40:22 2015 -0500
Committer: Tyler Hobbs <ty...@gmail.com>
Committed: Thu Jun 4 11:40:22 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                   |  1 +
 pylib/cqlshlib/cqlhandling.py | 18 +++++++++++++++++-
 pylib/cqlshlib/pylexotron.py  | 12 +++++++++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/13ecf33d/CHANGES.txt
----------------------------------------------------------------------