cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [3/3] git commit: Merge branch 'cassandra-1.2' into trunk
Date Mon, 04 Mar 2013 17:26:52 GMT
Updated Branches:
  refs/heads/trunk 25a31be4f -> 306a565a4


Merge branch 'cassandra-1.2' into trunk


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

Branch: refs/heads/trunk
Commit: 306a565a4e3bf41d52958a7924f47834a1e0206d
Parents: 25a31be 3c6f87e
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Mon Mar 4 18:26:44 2013 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Mon Mar 4 18:26:44 2013 +0100

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 +
 build.xml                                          |    1 +
 src/java/org/apache/cassandra/cql3/Constants.java  |   20 ++++++--
 src/java/org/apache/cassandra/cql3/Lists.java      |   18 ++++++-
 src/java/org/apache/cassandra/cql3/Maps.java       |   15 ++++-
 src/java/org/apache/cassandra/cql3/Sets.java       |    7 ++-
 .../cassandra/cql3/functions/FunctionCall.java     |    9 +++-
 .../cassandra/cql3/statements/SelectStatement.java |   40 ++++++++++++--
 .../cassandra/cql3/statements/UpdateStatement.java |   15 ++++-
 9 files changed, 105 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/build.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/src/java/org/apache/cassandra/cql3/Constants.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/Constants.java
index 896bd94,f630869..9904f05
--- a/src/java/org/apache/cassandra/cql3/Constants.java
+++ b/src/java/org/apache/cassandra/cql3/Constants.java
@@@ -277,9 -295,12 +280,12 @@@ public abstract class Constant
  
          public void execute(ByteBuffer rowKey, ColumnFamily cf, ColumnNameBuilder prefix,
UpdateParameters params) throws InvalidRequestException
          {
-             long increment = ByteBufferUtil.toLong(t.bindAndGet(params.variables));
+             ByteBuffer bytes = t.bindAndGet(params.variables);
+             if (bytes == null)
+                 throw new InvalidRequestException("Invalid null value for counter increment");
+             long increment = ByteBufferUtil.toLong(bytes);
              ByteBuffer cname = columnName == null ? prefix.build() : prefix.add(columnName.key).build();
 -            cf.addCounter(new QueryPath(cf.metadata().cfName, null, cname), increment);
 +            cf.addCounter(cname, increment);
          }
      }
  

http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/src/java/org/apache/cassandra/cql3/Lists.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/cql3/Lists.java
index 3eab387,76f947c..caa84b4
--- a/src/java/org/apache/cassandra/cql3/Lists.java
+++ b/src/java/org/apache/cassandra/cql3/Lists.java
@@@ -368,9 -377,12 +377,12 @@@ public abstract class List
          public void execute(ByteBuffer rowKey, ColumnFamily cf, ColumnNameBuilder prefix,
UpdateParameters params) throws InvalidRequestException
          {
              Term.Terminal index = t.bind(params.variables);
+             if (index == null)
+                 throw new InvalidRequestException("Invalid null value for list index");
+ 
              assert index instanceof Constants.Value;
  
 -            List<Pair<ByteBuffer, IColumn>> existingList = params.getPrefetchedList(rowKey,
columnName.key);
 +            List<Pair<ByteBuffer, Column>> existingList = params.getPrefetchedList(rowKey,
columnName.key);
              int idx = ByteBufferUtil.toInt(((Constants.Value)index).bytes);
              if (idx < 0 || idx >= existingList.size())
                  throw new InvalidRequestException(String.format("List index %d out of bound,
list has size %d", idx, existingList.size()));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/306a565a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
----------------------------------------------------------------------


Mime
View raw message