You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2018/11/20 15:27:05 UTC

[01/10] cassandra git commit: Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.2 dcd92a93a -> cf6f7920f
  refs/heads/cassandra-3.0 c6f822c2a -> c9dc69dce
  refs/heads/cassandra-3.11 78c7d57eb -> 54be1fa8f
  refs/heads/trunk 9944d9e24 -> 325d70d5a


Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-14899


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

Branch: refs/heads/cassandra-2.2
Commit: cf6f7920f7742bb9a17a23ad37499d9213807d81
Parents: dcd92a9
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Thu Nov 15 14:54:05 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:19:28 2018 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  5 ++++
 .../restrictions/PrimaryKeyRestrictionSet.java  | 24 +++++++++++--------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 3 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 71c57ea..bca036d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,10 @@
 2.2.14
+ * Cannot perform slice reads in reverse direction against tables with clustering columns
+   in mixed order (CASSANDRA-14899)
  * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262)
  * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 
+
 2.2.13
  * Fix bug that prevented compaction of SSTables after full repairs (CASSANDRA-14423)
  * Incorrect counting of pending messages in OutboundTcpConnection (CASSANDRA-11551)
@@ -15,6 +18,7 @@ Merged from 2.1:
  * Check checksum before decompressing data (CASSANDRA-14284)
  * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt (CASSANDRA-14183)
 
+
 2.2.12
  * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
  * Fix race that prevents submitting compaction for a table when executor is full (CASSANDRA-13801)
@@ -25,6 +29,7 @@ Merged from 2.1:
  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  * RPM package spec: fix permissions for installed jars and config files (CASSANDRA-14181)
 
+
 2.2.11
  * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
  * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
index 2549bdf..5136fee 100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
@@ -20,8 +20,6 @@ package org.apache.cassandra.cql3.restrictions;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import com.google.common.collect.Lists;
-
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.cql3.QueryOptions;
@@ -195,14 +193,12 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
                 // It is clearly a hack but it does not make a lot of sense to refactor 2.2 for that as the problem is
                 // already solved in 3.0.
                 List<Composite> composites = filterAndSort(setEocs(r, bound, builder.build()));
-                return Lists.transform(composites, new com.google.common.base.Function<Composite, Composite>()
-                {
-                    @Override
-                    public Composite apply(Composite composite)
-                    {
-                        return composite.isEmpty() ? Composites.EMPTY: composite;
-                    }
-                });
+
+                for (Composite c : composites)
+                    if (c.isEmpty())
+                        return normalizeEmptyComposites(composites);
+
+                return composites;
             }
 
             r.appendBoundTo(cfm, builder, bound, options);
@@ -239,6 +235,14 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
         return new ArrayList<>(set);
     }
 
+    private List<Composite> normalizeEmptyComposites(List<Composite> composites)
+    {
+        List<Composite> transformed = new ArrayList<>(composites.size());
+        for (Composite c : composites)
+            transformed.add(c.isEmpty() ? Composites.EMPTY : c);
+        return transformed;
+    }
+
     /**
      * Sets EOCs for the composites returned by the specified slice restriction for the given bound.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
index 0975662..4e5a1e6 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
@@ -1886,6 +1886,31 @@ public class SelectMultiColumnRelationTest extends CQLTester
         }
     }
 
+    @Test
+    public void testMixedOrderColumnsInReverse() throws Throwable
+    {
+        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH CLUSTERING ORDER BY (b ASC, c DESC);");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 1)");
+
+        assertRows(execute("SELECT b, c FROM %s WHERE a = 0 AND (b, c) >= (2, 2) ORDER BY b DESC, c ASC;"),
+                   row(3, 1),
+                   row(3, 2),
+                   row(3, 3),
+                   row(2, 2),
+                   row(2, 3));
+    }
+
     /**
      * Check select on tuple relations, see CASSANDRA-8613
      * migrated from cql_tests.py:TestCQL.simple_tuple_query_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[02/10] cassandra git commit: Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

Posted by al...@apache.org.
Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-14899


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

Branch: refs/heads/cassandra-3.0
Commit: cf6f7920f7742bb9a17a23ad37499d9213807d81
Parents: dcd92a9
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Thu Nov 15 14:54:05 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:19:28 2018 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  5 ++++
 .../restrictions/PrimaryKeyRestrictionSet.java  | 24 +++++++++++--------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 3 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 71c57ea..bca036d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,10 @@
 2.2.14
+ * Cannot perform slice reads in reverse direction against tables with clustering columns
+   in mixed order (CASSANDRA-14899)
  * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262)
  * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 
+
 2.2.13
  * Fix bug that prevented compaction of SSTables after full repairs (CASSANDRA-14423)
  * Incorrect counting of pending messages in OutboundTcpConnection (CASSANDRA-11551)
@@ -15,6 +18,7 @@ Merged from 2.1:
  * Check checksum before decompressing data (CASSANDRA-14284)
  * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt (CASSANDRA-14183)
 
+
 2.2.12
  * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
  * Fix race that prevents submitting compaction for a table when executor is full (CASSANDRA-13801)
@@ -25,6 +29,7 @@ Merged from 2.1:
  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  * RPM package spec: fix permissions for installed jars and config files (CASSANDRA-14181)
 
+
 2.2.11
  * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
  * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
index 2549bdf..5136fee 100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
@@ -20,8 +20,6 @@ package org.apache.cassandra.cql3.restrictions;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import com.google.common.collect.Lists;
-
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.cql3.QueryOptions;
@@ -195,14 +193,12 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
                 // It is clearly a hack but it does not make a lot of sense to refactor 2.2 for that as the problem is
                 // already solved in 3.0.
                 List<Composite> composites = filterAndSort(setEocs(r, bound, builder.build()));
-                return Lists.transform(composites, new com.google.common.base.Function<Composite, Composite>()
-                {
-                    @Override
-                    public Composite apply(Composite composite)
-                    {
-                        return composite.isEmpty() ? Composites.EMPTY: composite;
-                    }
-                });
+
+                for (Composite c : composites)
+                    if (c.isEmpty())
+                        return normalizeEmptyComposites(composites);
+
+                return composites;
             }
 
             r.appendBoundTo(cfm, builder, bound, options);
@@ -239,6 +235,14 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
         return new ArrayList<>(set);
     }
 
+    private List<Composite> normalizeEmptyComposites(List<Composite> composites)
+    {
+        List<Composite> transformed = new ArrayList<>(composites.size());
+        for (Composite c : composites)
+            transformed.add(c.isEmpty() ? Composites.EMPTY : c);
+        return transformed;
+    }
+
     /**
      * Sets EOCs for the composites returned by the specified slice restriction for the given bound.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
index 0975662..4e5a1e6 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
@@ -1886,6 +1886,31 @@ public class SelectMultiColumnRelationTest extends CQLTester
         }
     }
 
+    @Test
+    public void testMixedOrderColumnsInReverse() throws Throwable
+    {
+        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH CLUSTERING ORDER BY (b ASC, c DESC);");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 1)");
+
+        assertRows(execute("SELECT b, c FROM %s WHERE a = 0 AND (b, c) >= (2, 2) ORDER BY b DESC, c ASC;"),
+                   row(3, 1),
+                   row(3, 2),
+                   row(3, 3),
+                   row(2, 2),
+                   row(2, 3));
+    }
+
     /**
      * Check select on tuple relations, see CASSANDRA-8613
      * migrated from cql_tests.py:TestCQL.simple_tuple_query_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[09/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by al...@apache.org.
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/trunk
Commit: 54be1fa8f6ebf59ca33da6b558e440c708a061e5
Parents: 78c7d57 c9dc69d
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:23:55 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:23:55 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54be1fa8/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[06/10] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Posted by al...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.0
Commit: c9dc69dce61618834c0a43ded53e95f2d0480e1b
Parents: c6f822c cf6f792
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:23:42 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:23:42 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9dc69dc/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[05/10] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Posted by al...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/cassandra-3.11
Commit: c9dc69dce61618834c0a43ded53e95f2d0480e1b
Parents: c6f822c cf6f792
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:23:42 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:23:42 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9dc69dc/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[03/10] cassandra git commit: Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

Posted by al...@apache.org.
Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-14899


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

Branch: refs/heads/cassandra-3.11
Commit: cf6f7920f7742bb9a17a23ad37499d9213807d81
Parents: dcd92a9
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Thu Nov 15 14:54:05 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:19:28 2018 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  5 ++++
 .../restrictions/PrimaryKeyRestrictionSet.java  | 24 +++++++++++--------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 3 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 71c57ea..bca036d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,10 @@
 2.2.14
+ * Cannot perform slice reads in reverse direction against tables with clustering columns
+   in mixed order (CASSANDRA-14899)
  * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262)
  * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 
+
 2.2.13
  * Fix bug that prevented compaction of SSTables after full repairs (CASSANDRA-14423)
  * Incorrect counting of pending messages in OutboundTcpConnection (CASSANDRA-11551)
@@ -15,6 +18,7 @@ Merged from 2.1:
  * Check checksum before decompressing data (CASSANDRA-14284)
  * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt (CASSANDRA-14183)
 
+
 2.2.12
  * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
  * Fix race that prevents submitting compaction for a table when executor is full (CASSANDRA-13801)
@@ -25,6 +29,7 @@ Merged from 2.1:
  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  * RPM package spec: fix permissions for installed jars and config files (CASSANDRA-14181)
 
+
 2.2.11
  * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
  * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
index 2549bdf..5136fee 100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
@@ -20,8 +20,6 @@ package org.apache.cassandra.cql3.restrictions;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import com.google.common.collect.Lists;
-
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.cql3.QueryOptions;
@@ -195,14 +193,12 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
                 // It is clearly a hack but it does not make a lot of sense to refactor 2.2 for that as the problem is
                 // already solved in 3.0.
                 List<Composite> composites = filterAndSort(setEocs(r, bound, builder.build()));
-                return Lists.transform(composites, new com.google.common.base.Function<Composite, Composite>()
-                {
-                    @Override
-                    public Composite apply(Composite composite)
-                    {
-                        return composite.isEmpty() ? Composites.EMPTY: composite;
-                    }
-                });
+
+                for (Composite c : composites)
+                    if (c.isEmpty())
+                        return normalizeEmptyComposites(composites);
+
+                return composites;
             }
 
             r.appendBoundTo(cfm, builder, bound, options);
@@ -239,6 +235,14 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
         return new ArrayList<>(set);
     }
 
+    private List<Composite> normalizeEmptyComposites(List<Composite> composites)
+    {
+        List<Composite> transformed = new ArrayList<>(composites.size());
+        for (Composite c : composites)
+            transformed.add(c.isEmpty() ? Composites.EMPTY : c);
+        return transformed;
+    }
+
     /**
      * Sets EOCs for the composites returned by the specified slice restriction for the given bound.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
index 0975662..4e5a1e6 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
@@ -1886,6 +1886,31 @@ public class SelectMultiColumnRelationTest extends CQLTester
         }
     }
 
+    @Test
+    public void testMixedOrderColumnsInReverse() throws Throwable
+    {
+        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH CLUSTERING ORDER BY (b ASC, c DESC);");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 1)");
+
+        assertRows(execute("SELECT b, c FROM %s WHERE a = 0 AND (b, c) >= (2, 2) ORDER BY b DESC, c ASC;"),
+                   row(3, 1),
+                   row(3, 2),
+                   row(3, 3),
+                   row(2, 2),
+                   row(2, 3));
+    }
+
     /**
      * Check select on tuple relations, see CASSANDRA-8613
      * migrated from cql_tests.py:TestCQL.simple_tuple_query_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[04/10] cassandra git commit: Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

Posted by al...@apache.org.
Cannot perform slice reads in reverse direction against tables with clustering columns in mixed order

patch by Aleksey Yeschenko; reviewed by Alex Petrov for CASSANDRA-14899


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

Branch: refs/heads/trunk
Commit: cf6f7920f7742bb9a17a23ad37499d9213807d81
Parents: dcd92a9
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Thu Nov 15 14:54:05 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:19:28 2018 +0000

----------------------------------------------------------------------
 CHANGES.txt                                     |  5 ++++
 .../restrictions/PrimaryKeyRestrictionSet.java  | 24 +++++++++++--------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 3 files changed, 44 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 71c57ea..bca036d 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,7 +1,10 @@
 2.2.14
+ * Cannot perform slice reads in reverse direction against tables with clustering columns
+   in mixed order (CASSANDRA-14899)
  * Fix incorrect cqlsh results when selecting same columns multiple times (CASSANDRA-13262)
  * Returns null instead of NaN or Infinity in JSON strings (CASSANDRA-14377)
 
+
 2.2.13
  * Fix bug that prevented compaction of SSTables after full repairs (CASSANDRA-14423)
  * Incorrect counting of pending messages in OutboundTcpConnection (CASSANDRA-11551)
@@ -15,6 +18,7 @@ Merged from 2.1:
  * Check checksum before decompressing data (CASSANDRA-14284)
  * CVE-2017-5929 Security vulnerability in Logback warning in NEWS.txt (CASSANDRA-14183)
 
+
 2.2.12
  * Fix the inspectJvmOptions startup check (CASSANDRA-14112)
  * Fix race that prevents submitting compaction for a table when executor is full (CASSANDRA-13801)
@@ -25,6 +29,7 @@ Merged from 2.1:
  * More PEP8 compliance for cqlsh (CASSANDRA-14021)
  * RPM package spec: fix permissions for installed jars and config files (CASSANDRA-14181)
 
+
 2.2.11
  * Safely handle empty buffers when outputting to JSON (CASSANDRA-13868)
  * Copy session properties on cqlsh.py do_login (CASSANDRA-13847)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
index 2549bdf..5136fee 100644
--- a/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
+++ b/src/java/org/apache/cassandra/cql3/restrictions/PrimaryKeyRestrictionSet.java
@@ -20,8 +20,6 @@ package org.apache.cassandra.cql3.restrictions;
 import java.nio.ByteBuffer;
 import java.util.*;
 
-import com.google.common.collect.Lists;
-
 import org.apache.cassandra.config.CFMetaData;
 import org.apache.cassandra.config.ColumnDefinition;
 import org.apache.cassandra.cql3.QueryOptions;
@@ -195,14 +193,12 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
                 // It is clearly a hack but it does not make a lot of sense to refactor 2.2 for that as the problem is
                 // already solved in 3.0.
                 List<Composite> composites = filterAndSort(setEocs(r, bound, builder.build()));
-                return Lists.transform(composites, new com.google.common.base.Function<Composite, Composite>()
-                {
-                    @Override
-                    public Composite apply(Composite composite)
-                    {
-                        return composite.isEmpty() ? Composites.EMPTY: composite;
-                    }
-                });
+
+                for (Composite c : composites)
+                    if (c.isEmpty())
+                        return normalizeEmptyComposites(composites);
+
+                return composites;
             }
 
             r.appendBoundTo(cfm, builder, bound, options);
@@ -239,6 +235,14 @@ final class PrimaryKeyRestrictionSet extends AbstractPrimaryKeyRestrictions impl
         return new ArrayList<>(set);
     }
 
+    private List<Composite> normalizeEmptyComposites(List<Composite> composites)
+    {
+        List<Composite> transformed = new ArrayList<>(composites.size());
+        for (Composite c : composites)
+            transformed.add(c.isEmpty() ? Composites.EMPTY : c);
+        return transformed;
+    }
+
     /**
      * Sets EOCs for the composites returned by the specified slice restriction for the given bound.
      *

http://git-wip-us.apache.org/repos/asf/cassandra/blob/cf6f7920/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
index 0975662..4e5a1e6 100644
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
@@ -1886,6 +1886,31 @@ public class SelectMultiColumnRelationTest extends CQLTester
         }
     }
 
+    @Test
+    public void testMixedOrderColumnsInReverse() throws Throwable
+    {
+        createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH CLUSTERING ORDER BY (b ASC, c DESC);");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 1)");
+
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 3)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 2)");
+        execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 1)");
+
+        assertRows(execute("SELECT b, c FROM %s WHERE a = 0 AND (b, c) >= (2, 2) ORDER BY b DESC, c ASC;"),
+                   row(3, 1),
+                   row(3, 2),
+                   row(3, 3),
+                   row(2, 2),
+                   row(2, 3));
+    }
+
     /**
      * Check select on tuple relations, see CASSANDRA-8613
      * migrated from cql_tests.py:TestCQL.simple_tuple_query_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[07/10] cassandra git commit: Merge branch 'cassandra-2.2' into cassandra-3.0

Posted by al...@apache.org.
Merge branch 'cassandra-2.2' into cassandra-3.0


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

Branch: refs/heads/trunk
Commit: c9dc69dce61618834c0a43ded53e95f2d0480e1b
Parents: c6f822c cf6f792
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:23:42 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:23:42 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c9dc69dc/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[10/10] cassandra git commit: Merge branch 'cassandra-3.11' into trunk

Posted by al...@apache.org.
Merge branch 'cassandra-3.11' into trunk


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

Branch: refs/heads/trunk
Commit: 325d70d5a62e92c64aa5e0331e24390604a45d8f
Parents: 9944d9e 54be1fa
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:25:38 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:25:38 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/325d70d5/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------
diff --cc test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
index 52a7f47,30c727b..5062448
--- a/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
+++ b/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
@@@ -1561,317 -1603,346 +1561,342 @@@ public class SelectMultiColumnRelationT
      @Test
      public void testMixedOrderColumns4() throws Throwable
      {
 -        for (String compactOption : new String[]{"", " COMPACT STORAGE AND "})
 -        {
 -            createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, PRIMARY KEY (a, b, c, d, e)) WITH " +
 -                        compactOption +
 -                        "CLUSTERING ORDER BY (b ASC, c DESC, d DESC, e ASC)");
 -
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, -1, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, -1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, 1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, -1, 1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, -3, 1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 0, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 1, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 1, -1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 1, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, -1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, -1, -1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, -1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, -1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 1);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, -1, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 0, 0, 0, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, -1, 0, -1, 0);
 -            execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, -1, 0, 0, 0);
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e)<(?,?,?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, 1, 1, -1, 0, -1, -1),
 -
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -
 -            );
 -
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e) < (?,?,?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 1, 0, 0, 0, 1, 0, -1, -1),
 -                       row(0, 1, 0, 0, -1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e) <= (?,?,?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 1, 0, 0, 0, 1, 0, -1, -1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0)
 -            );
 -
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e)<=(?,?,?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, 1, 1, -1, 0, -1, -1),
 -
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c)<=(?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, -1, 0, -1, -1),
 -
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c)<(?,?) " +
 -            "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, -1, 0, -1, -1),
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e)<=(?,?,?,?) " +
 -            "AND (b)>=(?)", 0, 2, 0, 1, 1, -1),
 -
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e)<=(?,?,?,?) " +
 -            "AND (b)>(?)", 0, 2, 0, 1, 1, -1),
 -
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) <= (?,?,?,?)", 0, 1, 0, 0, 0),
 -                       row(0, -1, 0, 0, 0),
 -                       row(0, -1, 0, -1, 0),
 -                       row(0, 0, 0, 0, 0),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, -1, -1),
 -                       row(0, 1, -1, 1, 0),
 -                       row(0, 1, -1, 1, 1),
 -                       row(0, 1, -1, 0, 0)
 -            );
 -
 -            assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) > (?,?,?,?)", 0, 1, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -
 -            );
 -
 -            assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) >= (?,?,?,?)", 0, 1, 0, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d) >= (?,?,?)", 0, 1, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 1, 0, 0, -1),
 -                       row(0, 1, 0, 0, 0),
 -                       row(0, 1, 0, 0, 1),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d) > (?,?,?)", 0, 1, 0, 0),
 -                       row(0, 1, 1, 0, -1),
 -                       row(0, 1, 1, 0, 0),
 -                       row(0, 1, 1, 0, 1),
 -                       row(0, 1, 1, -1, 0),
 -                       row(0, 1, 0, 1, -1),
 -                       row(0, 1, 0, 1, 1),
 -                       row(0, 2, 0, 1, 1),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1),
 -                       row(0, 2, -3, 1, 1)
 -            );
 -
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b) < (?) ", 0, 0),
 -                       row(0, -1, 0, 0, 0), row(0, -1, 0, -1, 0)
 -            );
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b) <= (?) ", 0, -1),
 -                       row(0, -1, 0, 0, 0), row(0, -1, 0, -1, 0)
 -            );
 -            assertRows(execute(
 -            "SELECT * FROM %s" +
 -            " WHERE a = ? " +
 -            "AND (b,c,d,e) < (?,?,?,?) and (b,c,d,e) > (?,?,?,?) ", 0, 2, 0, 0, 0, 2, -2, 0, 0),
 -                       row(0, 2, 0, -1, 0),
 -                       row(0, 2, 0, -1, 1),
 -                       row(0, 2, -1, 1, 1)
 -            );
 -        }
 +        createTable("CREATE TABLE %s (a int, b int, c int, d int, e int, PRIMARY KEY (a, b, c, d, e)) WITH " +
 +                    "CLUSTERING ORDER BY (b ASC, c DESC, d DESC, e ASC)");
 +
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, -1, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, -1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, 0, 1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, -1, 1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 2, -3, 1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 0, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, -1, 1, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 1, -1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 1, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, -1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, 0, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 0, -1, -1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, -1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, -1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, 0, 1);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 1, 1, -1, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, 0, 0, 0, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, -1, 0, -1, 0);
 +        execute("INSERT INTO %s (a, b, c, d, e) VALUES (?, ?, ?, ?, ?)", 0, -1, 0, 0, 0);
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e)<(?,?,?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, 1, 1, -1, 0, -1, -1),
 +
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +
 +        );
 +
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e) < (?,?,?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 1, 0, 0, 0, 1, 0, -1, -1),
 +                   row(0, 1, 0, 0, -1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e) <= (?,?,?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 1, 0, 0, 0, 1, 0, -1, -1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0)
 +        );
 +
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e)<=(?,?,?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, 1, 1, -1, 0, -1, -1),
 +
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c)<=(?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, -1, 0, -1, -1),
 +
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c)<(?,?) " +
 +        "AND (b,c,d,e)>(?,?,?,?)", 0, 2, 0, -1, 0, -1, -1),
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e)<=(?,?,?,?) " +
 +        "AND (b)>=(?)", 0, 2, 0, 1, 1, -1),
 +
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e)<=(?,?,?,?) " +
 +        "AND (b)>(?)", 0, 2, 0, 1, 1, -1),
 +
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) <= (?,?,?,?)", 0, 1, 0, 0, 0),
 +                   row(0, -1, 0, 0, 0),
 +                   row(0, -1, 0, -1, 0),
 +                   row(0, 0, 0, 0, 0),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, -1, -1),
 +                   row(0, 1, -1, 1, 0),
 +                   row(0, 1, -1, 1, 1),
 +                   row(0, 1, -1, 0, 0)
 +        );
 +
 +        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) > (?,?,?,?)", 0, 1, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +
 +        );
 +
 +        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d,e) >= (?,?,?,?)", 0, 1, 0, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d) >= (?,?,?)", 0, 1, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 1, 0, 0, -1),
 +                   row(0, 1, 0, 0, 0),
 +                   row(0, 1, 0, 0, 1),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute("SELECT * FROM %s WHERE a = ? AND (b,c,d) > (?,?,?)", 0, 1, 0, 0),
 +                   row(0, 1, 1, 0, -1),
 +                   row(0, 1, 1, 0, 0),
 +                   row(0, 1, 1, 0, 1),
 +                   row(0, 1, 1, -1, 0),
 +                   row(0, 1, 0, 1, -1),
 +                   row(0, 1, 0, 1, 1),
 +                   row(0, 2, 0, 1, 1),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1),
 +                   row(0, 2, -3, 1, 1)
 +        );
 +
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b) < (?) ", 0, 0),
 +                   row(0, -1, 0, 0, 0), row(0, -1, 0, -1, 0)
 +        );
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b) <= (?) ", 0, -1),
 +                   row(0, -1, 0, 0, 0), row(0, -1, 0, -1, 0)
 +        );
 +        assertRows(execute(
 +        "SELECT * FROM %s" +
 +        " WHERE a = ? " +
 +        "AND (b,c,d,e) < (?,?,?,?) and (b,c,d,e) > (?,?,?,?) ", 0, 2, 0, 0, 0, 2, -2, 0, 0),
 +                   row(0, 2, 0, -1, 0),
 +                   row(0, 2, 0, -1, 1),
 +                   row(0, 2, -1, 1, 1)
 +        );
      }
  
+     @Test
+     public void testMixedOrderColumnsInReverse() throws Throwable
+     {
+         createTable("CREATE TABLE %s (a int, b int, c int, PRIMARY KEY (a, b, c)) WITH CLUSTERING ORDER BY (b ASC, c DESC);");
+ 
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 3)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 2)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 1, 1)");
+ 
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 3)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 2)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 2, 1)");
+ 
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 3)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 2)");
+         execute("INSERT INTO %s (a, b, c) VALUES (0, 3, 1)");
+ 
+         assertRows(execute("SELECT b, c FROM %s WHERE a = 0 AND (b, c) >= (2, 2) ORDER BY b DESC, c ASC;"),
+                    row(3, 1),
+                    row(3, 2),
+                    row(3, 3),
+                    row(2, 2),
+                    row(2, 3));
+     }
+ 
      /**
       * Check select on tuple relations, see CASSANDRA-8613
       * migrated from cql_tests.py:TestCQL.simple_tuple_query_test()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


[08/10] cassandra git commit: Merge branch 'cassandra-3.0' into cassandra-3.11

Posted by al...@apache.org.
Merge branch 'cassandra-3.0' into cassandra-3.11


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

Branch: refs/heads/cassandra-3.11
Commit: 54be1fa8f6ebf59ca33da6b558e440c708a061e5
Parents: 78c7d57 c9dc69d
Author: Aleksey Yeshchenko <al...@apple.com>
Authored: Tue Nov 20 15:23:55 2018 +0000
Committer: Aleksey Yeshchenko <al...@apple.com>
Committed: Tue Nov 20 15:23:55 2018 +0000

----------------------------------------------------------------------
 .../SelectMultiColumnRelationTest.java          | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54be1fa8/test/unit/org/apache/cassandra/cql3/validation/operations/SelectMultiColumnRelationTest.java
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org