Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6643510FF8 for ; Thu, 14 Nov 2013 08:31:22 +0000 (UTC) Received: (qmail 41620 invoked by uid 500); 14 Nov 2013 08:31:20 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 41596 invoked by uid 500); 14 Nov 2013 08:31:18 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 41586 invoked by uid 99); 14 Nov 2013 08:31:16 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 08:31:16 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B87228A9371; Thu, 14 Nov 2013 08:31:15 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: Follow-up for 6327 Date: Thu, 14 Nov 2013 08:31:15 +0000 (UTC) Updated Branches: refs/heads/cassandra-2.0 1d3a4dd44 -> 731f58fcd Follow-up for 6327 patch by krummas; reviewed by slebresne for CASSANDRA-6327 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/731f58fc Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/731f58fc Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/731f58fc Branch: refs/heads/cassandra-2.0 Commit: 731f58fcd9d7e9810069de2d3ba9516b784afd34 Parents: 1d3a4dd Author: Sylvain Lebresne Authored: Thu Nov 14 09:26:43 2013 +0100 Committer: Sylvain Lebresne Committed: Thu Nov 14 09:28:44 2013 +0100 ---------------------------------------------------------------------- src/java/org/apache/cassandra/db/marshal/CompositeType.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/731f58fc/src/java/org/apache/cassandra/db/marshal/CompositeType.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/db/marshal/CompositeType.java b/src/java/org/apache/cassandra/db/marshal/CompositeType.java index c9e2ab9..5c1b62a 100644 --- a/src/java/org/apache/cassandra/db/marshal/CompositeType.java +++ b/src/java/org/apache/cassandra/db/marshal/CompositeType.java @@ -220,8 +220,11 @@ public class CompositeType extends AbstractCompositeType public boolean intersects(List minColumnNames, List maxColumnNames, SliceQueryFilter filter) { assert minColumnNames.size() == maxColumnNames.size(); + outer: for (ColumnSlice slice : filter.slices) { + // This slices intersects if all component intersect. And we don't intersect + // only if no slice intersects ByteBuffer[] start = split(filter.isReversed() ? slice.finish : slice.start); ByteBuffer[] finish = split(filter.isReversed() ? slice.start : slice.finish); for (int i = 0; i < minColumnNames.size(); i++) @@ -229,9 +232,10 @@ public class CompositeType extends AbstractCompositeType AbstractType t = types.get(i); ByteBuffer s = i < start.length ? start[i] : ByteBufferUtil.EMPTY_BYTE_BUFFER; ByteBuffer f = i < finish.length ? finish[i] : ByteBufferUtil.EMPTY_BYTE_BUFFER; - if (t.intersects(minColumnNames.get(i), maxColumnNames.get(i), s, f)) - return true; + if (!t.intersects(minColumnNames.get(i), maxColumnNames.get(i), s, f)) + continue outer; } + return true; } return false; }