datetime: check overflow after interval operations
We may overflow supported years range if we proceed (multiple times) interval addition or subtraction operations. At the end of add/sub we check all interval subcomponents on validity of their value. Result of this check is returned in the encoded value to the Lua side, where less than 0 means underflow in some component, and greater than 0 overflow in subcomponent. Part of #6923 NO_DOC=fix NO_CHANGELOG=fix
Showing
- src/lib/core/datetime.c 47 additions, 7 deletionssrc/lib/core/datetime.c
- src/lib/core/datetime.h 29 additions, 3 deletionssrc/lib/core/datetime.h
- src/lua/datetime.lua 32 additions, 9 deletionssrc/lua/datetime.lua
- src/lua/tnt_datetime.c 3 additions, 3 deletionssrc/lua/tnt_datetime.c
- test/app-tap/datetime.test.lua 42 additions, 31 deletionstest/app-tap/datetime.test.lua
Loading
Please register or sign in to comment