You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ty...@apache.org on 2014/11/19 18:29:27 UTC

[4/4] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Merge branch 'cassandra-2.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: 25a4c9e1f7388b35d7c51bdb36766618026cb0c7
Parents: 289314a 084d93d
Author: Tyler Hobbs <ty...@datastax.com>
Authored: Wed Nov 19 11:28:51 2014 -0600
Committer: Tyler Hobbs <ty...@datastax.com>
Committed: Wed Nov 19 11:28:51 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                     |   2 +
 .../cql3/statements/SelectStatement.java        |  15 +-
 .../cassandra/cql3/MultiColumnRelationTest.java | 938 ++++++++++---------
 3 files changed, 494 insertions(+), 461 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 80c6872,01ea887..8dbcbc8
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,6 +1,14 @@@
 -2.0.12:
 +2.1.3
 + * Do more aggressive entire-sstable TTL expiry checks (CASSANDRA-8243)
 + * Add more log info if readMeter is null (CASSANDRA-8238)
 + * add check of the system wall clock time at startup (CASSANDRA-8305)
 + * Support for frozen collections (CASSANDRA-7859)
 + * Fix overflow on histogram computation (CASSANDRA-8028)
 + * Have paxos reuse the timestamp generation of normal queries (CASSANDRA-7801)
 + * Fix incremental repair not remove parent session on remote (CASSANDRA-8291)
 +Merged from 2.0:
+  * Fix some failing queries that use multi-column relations
+    on COMPACT STORAGE tables (CASSANDRA-8264)
   * Fix InvalidRequestException with ORDER BY (CASSANDRA-8286)
   * Disable SSLv3 for POODLE (CASSANDRA-8265)
   * Fix millisecond timestamps in Tracing (CASSANDRA-8297)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/25a4c9e1/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 09d1e52,db25716..688d1d5
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -1120,45 -1077,15 +1120,56 @@@ public class SelectStatement implement
          return expressions;
      }
  
 -    private void validateIndexExpressionValue(ByteBuffer value, CFDefinition.Name name) throws InvalidRequestException
 +    private static ByteBuffer validateIndexedValue(ColumnDefinition def, ByteBuffer value) throws InvalidRequestException
      {
          if (value == null)
 -            throw new InvalidRequestException(String.format("Unsupported null value for indexed column %s", name));
 +            throw new InvalidRequestException(String.format("Unsupported null value for indexed column %s", def.name));
          if (value.remaining() > 0xFFFF)
              throw new InvalidRequestException("Index expression values may not be larger than 64K");
 +        return value;
      }
  
 -    private static IndexOperator reverse(IndexOperator op)
++    private CellName makeExclusiveSliceBound(Bound bound, CellNameType type, QueryOptions options) throws InvalidRequestException
++    {
++        if (sliceRestriction.isInclusive(bound))
++            return null;
++
++        if (sliceRestriction.isMultiColumn())
++            return type.makeCellName(((MultiColumnRestriction.Slice) sliceRestriction).componentBounds(bound, options).toArray());
++        else
++            return type.makeCellName(sliceRestriction.bound(bound, options));
++    }
++
 +    private Iterator<Cell> applySliceRestriction(final Iterator<Cell> cells, final QueryOptions options) throws InvalidRequestException
 +    {
 +        assert sliceRestriction != null;
 +
 +        final CellNameType type = cfm.comparator;
-         final CellName excludedStart = sliceRestriction.isInclusive(Bound.START) ? null : type.makeCellName(sliceRestriction.bound(Bound.START, options));
-         final CellName excludedEnd = sliceRestriction.isInclusive(Bound.END) ? null : type.makeCellName(sliceRestriction.bound(Bound.END, options));
++        final CellName excludedStart = makeExclusiveSliceBound(Bound.START, type, options);
++        final CellName excludedEnd = makeExclusiveSliceBound(Bound.END, type, options);
 +
 +        return new AbstractIterator<Cell>()
 +        {
 +            protected Cell computeNext()
 +            {
 +                while (cells.hasNext())
 +                {
 +                    Cell c = cells.next();
 +
 +                    // For dynamic CF, the column could be out of the requested bounds (because we don't support strict bounds internally (unless
 +                    // the comparator is composite that is)), filter here
 +                    if ( (excludedStart != null && type.compare(c.name(), excludedStart) == 0)
 +                      || (excludedEnd != null && type.compare(c.name(), excludedEnd) == 0) )
 +                        continue;
 +
 +                    return c;
 +                }
 +                return endOfData();
 +            }
 +        };
 +    }
 +
 +    private static Operator reverse(Operator op)
      {
          switch (op)
          {