adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1171499412


##########
test/unit/org/apache/cassandra/cql3/CustomNowInSecondsTest.java:
##########
@@ -73,6 +79,48 @@ private void testSelectQuery(boolean prepared)
         assertEquals(0, executeSelect(format("SELECT * FROM %s.%s", ks, tbl), 
now + day + 1, prepared).size());
     }
 
+    @Test
+    public void testSelectQueryWitInthOverflow()
+    {
+        testSelectQueryOverflowingIntTimestamps(false);
+        testSelectQueryOverflowingIntTimestamps(true);
+    }
+
+    private void testSelectQueryOverflowingIntTimestamps(boolean prepared)
+    {
+        ExpirationDateOverflowPolicy origPolicy = 
ExpirationDateOverflowHandling.policy;
+        ExpirationDateOverflowHandling.policy = 
ExpirationDateOverflowPolicy.REJECT;
+
+        int ttl = Attributes.MAX_TTL - 10; // Give it a TTL that should 
overflow 'int' timestamps
+
+        String ks = createKeyspace("CREATE KEYSPACE %s WITH replication={ 
'class' : 'SimpleStrategy', 'replication_factor' : 1 }");
+        String tbl = createTable(ks, "CREATE TABLE %s (id int primary key, val 
int)");
+
+        // insert a row with an int overflowing timestamp. Behavior will 
depend on versions

Review Comment:
   ```suggestion
           // insert a row with an int overflowing timestamp. Behavior will 
depend on the used sstable version
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to