[Tarantool-patches] [PATCH v1 1/1] sql: fix comparison between DECIMAL and big DOUBLE

Igor Munkin imun at tarantool.org
Tue Sep 7 14:40:25 MSK 2021


Mergen,

Thanks for the patch! LGTM, with a few nits regarding the commit
message.

On 30.08.21, Mergen Imeev via Tarantool-patches wrote:
> This patch fixes comparison between DECIMAL value and DOUBLE values
> greater or equal to 1e38 or less or equal to -1e38. Now any DOUBLE value
> greater or equal to 1e38 is more than any DECIMAL value and DOUBLE
> value less or equal to -1e38 is less than any DECIMAL value.

Minor: Considering Vlad's review[1], I would explicitly mention the
order of the operands to be compared (DECIMAL is the left one, DOUBLE is
the right one). The opposite case works fine even prior to the patch.

Minor: It would be clearer, if you mention here that there are only 38
decimal digits in DECIMAL representation (hence, 1e38).

> 
> Closes #6376
> ---
> https://github.com/tarantool/tarantool/issues/6376
> https://github.com/tarantool/tarantool/tree/imeevma/gh-6376-fix-cmp-between-big-double-and-dec
> 
>  .../gh-6376-fix-incorrect-dec-inf-cmp.md      |  3 ++
>  src/box/sql/mem.c                             |  4 +-
>  test/sql-tap/engine.cfg                       |  1 +
>  .../gh-6376-wrong-double-to-dec-cmp.test.lua  | 38 +++++++++++++++++++
>  4 files changed, 44 insertions(+), 2 deletions(-)
>  create mode 100644 changelogs/unreleased/gh-6376-fix-incorrect-dec-inf-cmp.md
>  create mode 100755 test/sql-tap/gh-6376-wrong-double-to-dec-cmp.test.lua
> 

<snipped>

> -- 
> 2.25.1
> 

[1]: https://lists.tarantool.org/tarantool-patches/003f11f0-5ecc-2e69-dc89-47a34b5f24ac@tarantool.org/

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list