Repository: cassandra Updated Branches: refs/heads/trunk 7d9acdb10 -> 9510eb0f3
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/trunk Commit: 71e1219de71fe341316f8cab2f5faeea37ceff1e Parents: c26a7e7 Author: Benjamin Lerer <b_le...@hotmail.com> Authored: Tue Dec 9 13:56:25 2014 +0100 Committer: Aleksey Yeschenko <alek...@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]