cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [1/6] cassandra git commit: Prevent integer overflow of timestamps in CellTest and RowsTest
Date Fri, 15 Sep 2017 21:37:24 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 9ea61305e -> d79fc9a22
  refs/heads/cassandra-3.11 436761ed6 -> f9e7c2b69
  refs/heads/trunk 8b5d1acde -> bb542ce71


Prevent integer overflow of timestamps in CellTest and RowsTest

patch by Joel Knighton; reviewed by Jeff Jirsa for CASSANDRA-13866


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

Branch: refs/heads/cassandra-3.0
Commit: d79fc9a2258d10e8a54fd4136d5544e10ad3ddda
Parents: 9ea6130
Author: Joel Knighton <jkni@apache.org>
Authored: Wed Sep 13 18:35:10 2017 -0500
Committer: Joel Knighton <jkni@apache.org>
Committed: Fri Sep 15 16:16:37 2017 -0500

----------------------------------------------------------------------
 CHANGES.txt                                          | 1 +
 test/unit/org/apache/cassandra/db/CellTest.java      | 4 ++--
 test/unit/org/apache/cassandra/db/rows/RowsTest.java | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d79fc9a2/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a259545..7afbfaa 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.15
+ * Prevent integer overflow of timestamps in CellTest and RowsTest (CASSANDRA-13866)
  * Fix counter application order in short read protection (CASSANDRA-12872)
  * Don't block RepairJob execution on validation futures (CASSANDRA-13797)
  * Wait for all management tasks to complete before shutting down CLSM (CASSANDRA-13123)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d79fc9a2/test/unit/org/apache/cassandra/db/CellTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/CellTest.java b/test/unit/org/apache/cassandra/db/CellTest.java
index cd6000f..22f1b78 100644
--- a/test/unit/org/apache/cassandra/db/CellTest.java
+++ b/test/unit/org/apache/cassandra/db/CellTest.java
@@ -255,7 +255,7 @@ public class CellTest
     {
         ColumnDefinition m = cfm2.getColumnDefinition(new ColumnIdentifier("m", false));
         int now1 = FBUtilities.nowInSeconds();
-        long ts1 = now1*1000000;
+        long ts1 = now1*1000000L;
 
 
         Cell r1m1 = BufferCell.live(cfm2, m, ts1, bb(1), CellPath.create(bb(1)));
@@ -263,7 +263,7 @@ public class CellTest
         List<Cell> cells1 = Lists.newArrayList(r1m1, r1m2);
 
         int now2 = now1 + 1;
-        long ts2 = now2*1000000;
+        long ts2 = now2*1000000L;
         Cell r2m2 = BufferCell.live(cfm2, m, ts2, bb(1), CellPath.create(bb(2)));
         Cell r2m3 = BufferCell.live(cfm2, m, ts2, bb(2), CellPath.create(bb(3)));
         Cell r2m4 = BufferCell.live(cfm2, m, ts2, bb(3), CellPath.create(bb(4)));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d79fc9a2/test/unit/org/apache/cassandra/db/rows/RowsTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/db/rows/RowsTest.java b/test/unit/org/apache/cassandra/db/rows/RowsTest.java
index b47bea2..8683808 100644
--- a/test/unit/org/apache/cassandra/db/rows/RowsTest.java
+++ b/test/unit/org/apache/cassandra/db/rows/RowsTest.java
@@ -202,7 +202,7 @@ public class RowsTest
 
     private static long secondToTs(int now)
     {
-        return now * 1000000;
+        return now * 1000000L;
     }
 
     private static Row.Builder createBuilder(Clustering c, int now, ByteBuffer vVal, ByteBuffer
mKey, ByteBuffer mVal)


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


Mime
View raw message