cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Improve ORDER BY validation (CQL3)
Date Thu, 06 Sep 2012 15:50:36 GMT
Updated Branches:
  refs/heads/cassandra-1.1 8e03f7bdf -> 4177b58f1


Improve ORDER BY validation (CQL3)

patch by slebresne; reviewed by jbellis for CASSANDRA-4624


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

Branch: refs/heads/cassandra-1.1
Commit: 4177b58f1099cb9f8de87b9432014b0afac90da0
Parents: 8e03f7b
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Thu Sep 6 17:42:40 2012 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Sep 6 17:42:40 2012 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4177b58f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6e72892..4a5bfe9 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 1.1.6
   * (cql3) fix potential NPE with both equal and unequal restriction (CASSANDRA-4532)
+  * (cql3) improves ORDER BY validation (CASSANDRA-4624)
+
 
 1.1.5
  * add SecondaryIndex.reload API (CASSANDRA-4581)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/4177b58f/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 dd00c5c..1d0918e 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1070,8 +1070,8 @@ public class SelectStatement implements CQLStatement
 
             if (!stmt.parameters.orderings.isEmpty())
             {
-                if (whereClause.isEmpty())
-                    throw new InvalidRequestException("ORDER BY is only supported in combination
with WHERE clause.");
+                if (stmt.isKeyRange())
+                    throw new InvalidRequestException("ORDER BY is only supported when the
partition key is restricted by an EQ or an IN.");
 
                 Boolean[] reversedMap = new Boolean[cfDef.columns.size()];
                 int i = 0;


Mime
View raw message