cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject cassandra git commit: Throw correct exception when trying to bind a keyspace or table name
Date Tue, 09 Dec 2014 12:57:25 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 c26a7e767 -> 71e1219de


Throw correct exception when trying to bind a keyspace or table name

patch by Benjamin Lerer; reviewed by Aleksey Yeschenko for
CASSANDRA-6952


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

Branch: refs/heads/cassandra-2.0
Commit: 71e1219de71fe341316f8cab2f5faeea37ceff1e
Parents: c26a7e7
Author: Benjamin Lerer <b_lerer@hotmail.com>
Authored: Tue Dec 9 13:56:25 2014 +0100
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue Dec 9 13:56:25 2014 +0100

----------------------------------------------------------------------
 CHANGES.txt                              | 2 ++
 src/java/org/apache/cassandra/cql3/Cql.g | 1 +
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/71e1219d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5573316..7c89e60 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.12:
+ * Throw correct exception when trying to bind a keyspace or table
+   name (CASSANDRA-6952)
  * Make HHOM.compact synchronized (CASSANDRA-8416)
  * cancel latency-sampling task when CF is dropped (CASSANDRA-8401)
  * don't block SocketThread for MessagingService (CASSANDRA-8188)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/71e1219d/src/java/org/apache/cassandra/cql3/Cql.g
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/Cql.g b/src/java/org/apache/cassandra/cql3/Cql.g
index 43b1c01..a80746c 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -771,6 +771,7 @@ cfOrKsName[CFName name, boolean isKs]
     : t=IDENT              { if (isKs) $name.setKeyspace($t.text, false); else $name.setColumnFamily($t.text,
false); }
     | t=QUOTED_NAME        { if (isKs) $name.setKeyspace($t.text, true); else $name.setColumnFamily($t.text,
true); }
     | k=unreserved_keyword { if (isKs) $name.setKeyspace(k, false); else $name.setColumnFamily(k,
false); }
+    | QMARK {addRecognitionError("Bind variables cannot be used for keyspace or table names");}
     ;
 
 constant returns [Constants.Literal constant]


Mime
View raw message