cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [3/6] git commit: Refuse ttl/writetime function on collection
Date Mon, 26 Nov 2012 18:23:22 GMT
Refuse ttl/writetime function on collection

patch by slebresne; reviewed by yukim for CASSANDRA-4992


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

Branch: refs/heads/trunk
Commit: b44abadafb5e54e579c2e726036ca07c8f74b3f4
Parents: f5a4a1d
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Nov 26 19:22:01 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Nov 26 19:22:01 2012 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |    1 +
 .../cassandra/cql3/statements/SelectStatement.java |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b44abada/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f4e2395..82fe9a9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -24,6 +24,7 @@
  * (CQL3) Force using ALLOW FILTERING on potentially inefficient queries (CASSANDRA-4915)
  * Fix adding column when the table has collections (CASSANDRA-4982)
  * Fix allowing collections with compact storage (CASSANDRA-4990)
+ * Refuse ttl/writetime function on collections (CASSANDRA-4992)
 Merged from 1.1:
  * add basic authentication support for Pig CassandraStorage (CASSANDRA-3042)
  * fix CQL2 ALTER TABLE compaction_strategy_class altering (CASSANDRA-4965)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b44abada/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 7d5bd15..4951998 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1007,6 +1007,8 @@ public class SelectStatement implements CQLStatement
                         throw new InvalidRequestException(String.format("Undefined name %s
in selection clause", t.id()));
                     if (t.hasFunction() && name.kind != CFDefinition.Name.Kind.COLUMN_METADATA
&& name.kind != CFDefinition.Name.Kind.VALUE_ALIAS)
                         throw new InvalidRequestException(String.format("Cannot use function
%s on PRIMARY KEY part %s", t.function(), name));
+                    if (t.hasFunction() && name.type.isCollection())
+                        throw new InvalidRequestException(String.format("Function %s is not
supported on collections", t.function()));
 
                     stmt.selectedNames.add(Pair.create(name, t));
                 }


Mime
View raw message