Closed
Description
It is allowed to create intervals with values bigger than int32 for minutes and seconds.
tarantool/src/lua/datetime.lua
Lines 144 to 145 in ff57f99
Since double
s are used to store values, interval itself can process such big values.
tarantool/src/lib/core/datetime.h
Lines 109 to 128 in 054526a
Msgpack encoding also succeeds:
tarantool> msgpack.encode(datetime.interval.new{min=6184879877159}):hex()
---
- c70d060205cf000005a007916c270801
...
Yet msgpack decoding fails:
tarantool> msgpack.decode(msgpack.encode(datetime.interval.new{min=6184879877159}))
---
- error: 'msgpack.decode: invalid MsgPack'
...
The reason is that int32 is used to extract the value
tarantool/src/lib/core/mp_interval.c
Line 130 in 054526a
while allowed values are not really restricted to int32. (For example, msgpack above has uint64 value for minutes.)