adelapena commented on code in PR #1891:
URL: https://github.com/apache/cassandra/pull/1891#discussion_r1107057240
##########
test/unit/org/apache/cassandra/cql3/CustomNowInSecondsTest.java:
##########
@@ -73,6 +73,32 @@ private void testSelectQuery(boolean prepared)
assertEquals(0, executeSelect(format("SELECT * FROM %s.%s", ks, tbl),
now + day + 1, prepared).size());
}
+ @Test
+ public void testSelectQueryWithOverflow()
+ {
+ testSelectQueryOverflowingIntTimestamps(false);
+ testSelectQueryOverflowingIntTimestamps(true);
+ }
+
+ private void testSelectQueryOverflowingIntTimestamps(boolean prepared)
+ {
+ 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 TTL = 1 day.
Review Comment:
Isn't the TTL 20 years minus ten seconds?
--
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]