mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-28 12:17:02 +00:00
The expiration-time attribute used by Alternator's TTL feature has a numeric type, meaning that it may be a floating point number - not just an integer, and implemented as big_decimal which has a separate integer mantissa and exponent. Our code which checked expiration incorrectly looked only at the mantissa - resulting in incorrect handling of expiration times which have a fractional part - 123.4 was treated as 1234 instead of 123. This patch fixes the big_decimal handling in the expiration checking, and also adds to the test test_ttl.py::test_ttl_expiration check also for non-integer floating point as well as one with an exponent. The new tests pass on DynamoDB, and failed on Alternator before this patch - and pass with it. Signed-off-by: Nadav Har'El <nyh@scylladb.com>