You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by sn...@apache.org on 2015/09/13 11:38:14 UTC

[04/10] cassandra git commit: BATCH statement is broken in cqlsh

BATCH statement is broken in cqlsh

patch by Stefania; reviewed by Robert Stupp for CASSANDRA-10272


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

Branch: refs/heads/trunk
Commit: ae5108645fc5e04888ab5cf08d3a03730b90ff30
Parents: 488db6f
Author: Stefania <st...@datastax.com>
Authored: Sun Sep 13 11:33:14 2015 +0200
Committer: Robert Stupp <sn...@snazy.de>
Committed: Sun Sep 13 11:33:14 2015 +0200

----------------------------------------------------------------------
 CHANGES.txt                    | 1 +
 pylib/cqlshlib/cql3handling.py | 2 +-
 pylib/cqlshlib/cqlhandling.py  | 4 ++--
 3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae510864/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4e0df42..dff47fc 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.10
+ * BATCH statement is broken in cqlsh (CASSANDRA-10272)
  * Added configurable warning threshold for GC duration (CASSANDRA-8907)
  * (cqlsh) Make cqlsh PEP8 compliant (CASSANDRA-10066)
  * (cqlsh) Fix error when starting cqlsh with --debug (CASSANDRA-10282)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae510864/pylib/cqlshlib/cql3handling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cql3handling.py b/pylib/cqlshlib/cql3handling.py
index 74b1281..bc4f2ef 100644
--- a/pylib/cqlshlib/cql3handling.py
+++ b/pylib/cqlshlib/cql3handling.py
@@ -1221,7 +1221,7 @@ def username_name_completer(ctxt, cass):
         return "'%s'" % name
 
     # disable completion for CREATE USER.
-    if ctxt.matched[0][0] == 'create':
+    if ctxt.matched[0][1].upper() == 'CREATE':
         return [Hint('<username>')]
 
     session = cass.session

http://git-wip-us.apache.org/repos/asf/cassandra/blob/ae510864/pylib/cqlshlib/cqlhandling.py
----------------------------------------------------------------------
diff --git a/pylib/cqlshlib/cqlhandling.py b/pylib/cqlshlib/cqlhandling.py
index 31c636c..5fe311f 100644
--- a/pylib/cqlshlib/cqlhandling.py
+++ b/pylib/cqlshlib/cqlhandling.py
@@ -138,9 +138,9 @@ class CqlParsingRuleSet(pylexotron.ParsingRuleSet):
             else:
                 output.append(stmt)
             if len(stmt) > 2:
-                if stmt[-3][0] == 'apply':
+                if stmt[-3][1].upper() == 'APPLY':
                     in_batch = False
-                elif stmt[0][0] == 'begin':
+                elif stmt[0][1].upper() == 'BEGIN':
                     in_batch = True
         return output, in_batch