You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2013/12/17 15:49:56 UTC

[2/8] git commit: Slightly improved message when parsing properties for DDL queries

Slightly improved message when parsing properties for DDL queries

patch by boneill42; reviewed by slebresne for CASSANDRA-6453


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

Branch: refs/heads/trunk
Commit: 54a1955d254bfc89e48389d5d0d94c79d027d470
Parents: 4be9e67
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Mon Dec 16 10:53:22 2013 +0100
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Mon Dec 16 10:53:22 2013 +0100

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54a1955d/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b55393b..4816d70 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,6 @@
+1.2.14
+ * Improved error message on bad properties in DDL queries (CASSANDRA-6453)
+
 1.2.13
  * Randomize batchlog candidates selection (CASSANDRA-6481)
  * Fix thundering herd on endpoint cache invalidation (CASSANDRA-6345, 6485)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54a1955d/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 7101c71..ea6844f 100644
--- a/src/java/org/apache/cassandra/cql3/Cql.g
+++ b/src/java/org/apache/cassandra/cql3/Cql.g
@@ -93,12 +93,18 @@ options {
 
             if (!(entry.left instanceof Constants.Literal))
             {
-                addRecognitionError("Invalid property name: " + entry.left);
+                String msg = "Invalid property name: " + entry.left;
+                if (entry.left instanceof AbstractMarker.Raw)
+                    msg += " (bind variables are not supported in DDL queries)";
+                addRecognitionError(msg);
                 break;
             }
             if (!(entry.right instanceof Constants.Literal))
             {
-                addRecognitionError("Invalid property value: " + entry.right);
+                String msg = "Invalid property value: " + entry.right + " for property: " + entry.left;
+                if (entry.right instanceof AbstractMarker.Raw)
+                    msg += " (bind variables are not supported in DDL queries)";
+                addRecognitionError(msg);
                 break;
             }