cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Better error message when order by is used with 2ndary indexes
Date Mon, 26 Nov 2012 15:38:36 GMT
Updated Branches:
  refs/heads/cassandra-1.1 d0292ef45 -> cb7a231a2


Better error message when order by is used with 2ndary indexes


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

Branch: refs/heads/cassandra-1.1
Commit: cb7a231a2f6ff42b8428139d8445a2b0499f40ff
Parents: d0292ef
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Nov 26 16:38:23 2012 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Nov 26 16:38:23 2012 +0100

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cb7a231a/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 2cb008e..967d18f 100644
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@ -1115,6 +1115,9 @@ public class SelectStatement implements CQLStatement
 
             if (!stmt.parameters.orderings.isEmpty())
             {
+                if (!stmt.metadataRestrictions.isEmpty())
+                    throw new InvalidRequestException("ORDER BY with 2ndary indexes is not
supported.");
+
                 if (stmt.isKeyRange())
                     throw new InvalidRequestException("ORDER BY is only supported when the
partition key is restricted by an EQ or an IN.");
 


Mime
View raw message