Merge branch 'cassandra-1.2' into cassandra-2.0

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

Branch: refs/heads/trunk
Commit: 975145c2779a5d99c9f5f192f0693bfb40a9001c
Parents: 50599d2 7bbeb5a
Author: Sylvain Lebresne <sylv...@datastax.com>
Authored: Thu May 29 12:49:19 2014 +0200
Committer: Sylvain Lebresne <sylv...@datastax.com>
Committed: Thu May 29 12:49:19 2014 +0200

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


http://git-wip-us.apache.org/repos/asf/cassandra/blob/975145c2/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 523dda3,619c219..d83b5af
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -66,61 -24,10 +66,62 @@@ Merged from 1.2
   * raise streaming phi convict threshold level (CASSANDRA-7063)
   * reduce garbage creation in calculatePendingRanges (CASSANDRA-7191)
   * exit CQLSH with error status code if script fails (CASSANDRA-6344)
+  * Fix bug with some IN queries missig results (CASSANDRA-7105)
  
  
 -1.2.16
 +2.0.7
 + * Put nodes in hibernate when join_ring is false (CASSANDRA-6961)
 + * Avoid early loading of non-system keyspaces before compaction-leftovers 
 +   cleanup at startup (CASSANDRA-6913)
 + * Restrict Windows to parallel repairs (CASSANDRA-6907)
 + * (Hadoop) Allow manually specifying start/end tokens in CFIF 
(CASSANDRA-6436)
 + * Fix NPE in MeteredFlusher (CASSANDRA-6820)
 + * Fix race processing range scan responses (CASSANDRA-6820)
 + * Allow deleting snapshots from dropped keyspaces (CASSANDRA-6821)
 + * Add uuid() function (CASSANDRA-6473)
 + * Omit tombstones from schema digests (CASSANDRA-6862)
 + * Include correct consistencyLevel in LWT timeout (CASSANDRA-6884)
 + * Lower chances for losing new SSTables during nodetool refresh and
 +   ColumnFamilyStore.loadNewSSTables (CASSANDRA-6514)
 + * Add support for DELETE ... IF EXISTS to CQL3 (CASSANDRA-5708)
 + * Update hadoop_cql3_word_count example (CASSANDRA-6793)
 + * Fix handling of RejectedExecution in sync Thrift server (CASSANDRA-6788)
 + * Log more information when exceeding tombstone_warn_threshold 
(CASSANDRA-6865)
 + * Fix truncate to not abort due to unreachable fat clients (CASSANDRA-6864)
 + * Fix schema concurrency exceptions (CASSANDRA-6841)
 + * Fix leaking validator FH in StreamWriter (CASSANDRA-6832)
 + * Fix saving triggers to schema (CASSANDRA-6789)
 + * Fix trigger mutations when base mutation list is immutable (CASSANDRA-6790)
 + * Fix accounting in FileCacheService to allow re-using RAR (CASSANDRA-6838)
 + * Fix static counter columns (CASSANDRA-6827)
 + * Restore expiring->deleted (cell) compaction optimization (CASSANDRA-6844)
 + * Fix CompactionManager.needsCleanup (CASSANDRA-6845)
 + * Correctly compare BooleanType values other than 0 and 1 (CASSANDRA-6779)
 + * Read message id as string from earlier versions (CASSANDRA-6840)
 + * Properly use the Paxos consistency for (non-protocol) batch 
(CASSANDRA-6837)
 + * Add paranoid disk failure option (CASSANDRA-6646)
 + * Improve PerRowSecondaryIndex performance (CASSANDRA-6876)
 + * Extend triggers to support CAS updates (CASSANDRA-6882)
 + * Static columns with IF NOT EXISTS don't always work as expected 
(CASSANDRA-6873)
 + * Fix paging with SELECT DISTINCT (CASSANDRA-6857)
 + * Fix UnsupportedOperationException on CAS timeout (CASSANDRA-6923)
 + * Improve MeteredFlusher handling of MF-unaffected column families
 +   (CASSANDRA-6867)
 + * Add CqlRecordReader using native pagination (CASSANDRA-6311)
 + * Add QueryHandler interface (CASSANDRA-6659)
 + * Track liveRatio per-memtable, not per-CF (CASSANDRA-6945)
 + * Make sure upgradesstables keeps sstable level (CASSANDRA-6958)
 + * Fix LIMIT with static columns (CASSANDRA-6956)
 + * Fix clash with CQL column name in thrift validation (CASSANDRA-6892)
 + * Fix error with super columns in mixed 1.2-2.0 clusters (CASSANDRA-6966)
 + * Fix bad skip of sstables on slice query with composite start/finish 
(CASSANDRA-6825)
 + * Fix unintended update with conditional statement (CASSANDRA-6893)
 + * Fix map element access in IF (CASSANDRA-6914)
 + * Avoid costly range calculations for range queries on system keyspaces
 +   (CASSANDRA-6906)
 + * Fix SSTable not released if stream session fails (CASSANDRA-6818)
 + * Avoid build failure due to ANTLR timeout (CASSANDRA-6991)
 +Merged from 1.2:
   * Add UNLOGGED, COUNTER options to BATCH documentation (CASSANDRA-6816)
   * add extra SSL cipher suites (CASSANDRA-6613)
   * fix nodetool getsstables for blob PK (CASSANDRA-6803)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/975145c2/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
index 8f061d2,02833e7..2710f78
--- a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
@@@ -862,12 -626,12 +862,12 @@@ public class SelectStatement implement
                              throw new 
InvalidRequestException(String.format("Invalid null clustering key part %s", 
name));
                          ColumnNameBuilder copy = builder.copy().add(val);
                          // See below for why this
-                         s.add((b == Bound.END && copy.remainingCount() > 0) ? 
copy.buildAsEndOfRange() : copy.build());
+                         s.add((eocBound == Bound.END && copy.remainingCount() 
> 0) ? copy.buildAsEndOfRange() : copy.build());
                      }
 -                    return new ArrayList<ByteBuffer>(s);
 +                    return new ArrayList<>(s);
                  }
  
 -                ByteBuffer val = r.eqValues.get(0).bindAndGet(variables);
 +                ByteBuffer val = values.get(0);
                  if (val == null)
                      throw new InvalidRequestException(String.format("Invalid 
null clustering key part %s", name));
                  builder.add(val);
@@@ -879,98 -652,9 +879,98 @@@
          // with 2ndary index is done, and with the the partition provided 
with an EQ, we'll end up here, and in that
          // case using the eoc would be bad, since for the random partitioner 
we have no guarantee that
          // builder.buildAsEndOfRange() will sort after builder.build() (see 
#5240).
-         return Collections.singletonList((bound == Bound.END && 
builder.remainingCount() > 0) ? builder.buildAsEndOfRange() : builder.build());
+         return Collections.singletonList((eocBound == Bound.END && 
builder.remainingCount() > 0) ? builder.buildAsEndOfRange() : builder.build());
      }
  
 +    private List<ByteBuffer> buildMultiColumnSliceBound(Bound bound,
 +                                                        
Collection<CFDefinition.Name> names,
 +                                                        
MultiColumnRestriction.Slice slice,
 +                                                        boolean isReversed,
 +                                                        ColumnNameBuilder 
builder,
 +                                                        List<ByteBuffer> 
variables) throws InvalidRequestException
 +    {
 +        Bound eocBound = isReversed ? Bound.reverse(bound) : bound;
 +
 +        Iterator<CFDefinition.Name> iter = names.iterator();
 +        CFDefinition.Name firstName = iter.next();
 +        // A hack to preserve pre-6875 behavior for tuple-notation slices 
where the comparator mixes ASCENDING
 +        // and DESCENDING orders.  This stores the bound for the first 
component; we will re-use it for all following
 +        // components, even if they don't match the first component's 
reversal/non-reversal.  Note that this does *not*
 +        // guarantee correct query results, it just preserves the previous 
behavior.
 +        Bound firstComponentBound = isReversed == isReversedType(firstName) ? 
bound : Bound.reverse(bound);
 +
 +        if (!slice.hasBound(firstComponentBound))
 +            return Collections.singletonList(builder.componentCount() > 0 && 
eocBound == Bound.END
 +                    ? builder.buildAsEndOfRange()
 +                    : builder.build());
 +
 +        List<ByteBuffer> vals = slice.componentBounds(firstComponentBound, 
variables);
 +        builder.add(vals.get(firstName.position));
 +
 +        while(iter.hasNext())
 +        {
 +            CFDefinition.Name name = iter.next();
 +            if (name.position >= vals.size())
 +                break;
 +
 +            builder.add(vals.get(name.position));
 +        }
 +        Relation.Type relType = slice.getRelation(eocBound, 
firstComponentBound);
 +        return Collections.singletonList(builder.buildForRelation(relType));
 +    }
 +
 +    private List<ByteBuffer> buildMultiColumnInBound(Bound bound,
 +                                                     
Collection<CFDefinition.Name> names,
 +                                                     
MultiColumnRestriction.IN restriction,
 +                                                     boolean isReversed,
 +                                                     ColumnNameBuilder 
builder,
 +                                                     List<ByteBuffer> 
variables) throws InvalidRequestException
 +    {
 +        List<List<ByteBuffer>> splitInValues = 
restriction.splitValues(variables);
 +
 +        // The IN query might not have listed the values in comparator order, 
so we need to re-sort
 +        // the bounds lists to make sure the slices works correctly (also, to 
avoid duplicates).
 +        TreeSet<ByteBuffer> inValues = new TreeSet<>(isReversed ? 
cfDef.cfm.comparator.reverseComparator : cfDef.cfm.comparator);
 +        Iterator<CFDefinition.Name> iter = names.iterator();
 +        for (List<ByteBuffer> components : splitInValues)
 +        {
 +            ColumnNameBuilder nameBuilder = builder.copy();
 +            for (ByteBuffer component : components)
 +                nameBuilder.add(component);
 +
 +            Bound b = isReversed == isReversedType(iter.next()) ? bound : 
Bound.reverse(bound);
 +            inValues.add((bound == Bound.END && nameBuilder.remainingCount() 
> 0) ? nameBuilder.buildAsEndOfRange() : nameBuilder.build());
 +        }
 +        return new ArrayList<>(inValues);
 +    }
 +
 +    private List<ByteBuffer> buildMultiColumnEQBound(Bound bound, 
MultiColumnRestriction.EQ restriction, boolean isReversed, ColumnNameBuilder 
builder, List<ByteBuffer> variables) throws InvalidRequestException
 +    {
 +        Bound eocBound = isReversed ? Bound.reverse(bound) : bound;
 +        for (ByteBuffer component : restriction.values(variables))
 +            builder.add(component);
 +
 +        ByteBuffer result = builder.componentCount() > 0 && eocBound == 
Bound.END
 +                ? builder.buildAsEndOfRange()
 +                : builder.build();
 +        return Collections.singletonList(result);
 +    }
 +
 +    private static boolean isNullRestriction(Restriction r, Bound b)
 +    {
 +        return r == null || (r.isSlice() && 
!((Restriction.Slice)r).hasBound(b));
 +    }
 +
 +    private static ByteBuffer getSliceValue(Restriction r, Bound b, 
List<ByteBuffer> variables) throws InvalidRequestException
 +    {
 +        Restriction.Slice slice = (Restriction.Slice)r;
 +        assert slice.hasBound(b);
 +        ByteBuffer val = slice.bound(b, variables);
 +        if (val == null)
 +            throw new InvalidRequestException(String.format("Invalid null 
clustering key part %s", r));
 +        return val;
 +    }
 +
      private List<ByteBuffer> getRequestedBound(Bound b, List<ByteBuffer> 
variables) throws InvalidRequestException
      {
          assert isColumnRange();

Reply via email to