From: Serge Petrenko <sergepetrenko@tarantool.org> To: vdavydov.dev@gmail.com Cc: tarantool-patches@freelists.org, Serge Petrenko <sergepetrenko@tarantool.org> Subject: [PATCH 0/5] Decimal indices Date: Wed, 17 Jul 2019 18:33:41 +0300 [thread overview] Message-ID: <cover.1563376957.git.sergepetrenko@tarantool.org> (raw) https://github.com/tarantool/tarantool/issues/4333 https://github.com/tarantool/tarantool/tree/sp/gh-4333-decimal-index This patchset adds the ability to insert decimal values into spaces and to build indices over decimal fields. The first patch fixes a bug in decimal.round() found during working on the patchset. This bug prevented correct hint calculations for some decimal values. The second patch updates msgpack library with the ability to encode/decode decimals as msgpack The third patch propagates the msgpack changes to msgpack Lua module. This allows to insert decimals into spaces, but only into unindexed fields. The fourth patch updates the decNumber library with new ToUInt64 and ToInt64 functions and adds the corresponding wrappers to our decimal module. These functions are needed for hint calculation. The fifth patch adds a new field type, 'decimal', allows to store decimal values in 'decimal', 'scalar' and 'number' fields, and adds all the code necessary for hint calculations over decimal fields. Serge Petrenko (5): decimal: fix decimal.round() when scale == 0 decimal: allow to encode/decode decimals as MsgPack lua: allow to encode and decode decimals as msgpack decimal: add conversions to (u)int64_t decimal: allow to index decimals extra/exports | 4 + src/box/field_def.c | 43 ++++-- src/box/field_def.h | 16 +- src/box/key_def.h | 2 +- src/box/tuple_compare.cc | 160 +++++++++++++++++++- src/box/tuple_format.c | 2 +- src/lib/core/CMakeLists.txt | 1 + src/lib/core/decimal.c | 81 ++++++++-- src/lib/core/decimal.h | 20 +++ src/lib/core/mp_decimal.c | 72 +++++++++ src/lib/core/mp_decimal.h | 70 +++++++++ src/lib/core/mp_user_types.h | 39 +++++ src/lib/core/mpstream.c | 11 ++ src/lib/core/mpstream.h | 4 + src/lua/decimal.c | 10 +- src/lua/decimal.h | 5 + src/lua/msgpack.c | 52 +++++-- src/lua/msgpackffi.lua | 33 +++++ src/lua/utils.c | 16 +- src/lua/utils.h | 8 +- test/app/decimal.result | 116 +++++++++------ test/app/decimal.test.lua | 6 + test/app/msgpack.result | 41 +++++ test/app/msgpack.test.lua | 15 ++ test/engine/decimal.result | 226 ++++++++++++++++++++++++++++ test/engine/decimal.test.lua | 65 ++++++++ test/unit/decimal.c | 124 +++++++++++++++- test/unit/decimal.result | 272 +++++++++++++++++++++++++++++++++- third_party/decNumber | 2 +- third_party/lua-yaml/lyaml.cc | 6 + 30 files changed, 1420 insertions(+), 102 deletions(-) create mode 100644 src/lib/core/mp_decimal.c create mode 100644 src/lib/core/mp_decimal.h create mode 100644 src/lib/core/mp_user_types.h create mode 100644 test/engine/decimal.result create mode 100644 test/engine/decimal.test.lua -- 2.20.1 (Apple Git-117)
next reply other threads:[~2019-07-17 15:33 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-07-17 15:33 Serge Petrenko [this message] 2019-07-17 15:33 ` [PATCH 1/5] decimal: fix decimal.round() when scale == 0 Serge Petrenko 2019-07-24 12:10 ` Vladimir Davydov 2019-07-24 23:02 ` [tarantool-patches] " Konstantin Osipov 2019-07-17 15:33 ` [PATCH 2/5] decimal: allow to encode/decode decimals as MsgPack Serge Petrenko 2019-07-24 16:19 ` Vladimir Davydov 2019-07-24 23:08 ` [tarantool-patches] " Konstantin Osipov 2019-07-17 15:33 ` [PATCH 3/5] lua: allow to encode and decode decimals as msgpack Serge Petrenko 2019-07-24 14:11 ` Vladimir Davydov 2019-07-24 23:10 ` [tarantool-patches] " Konstantin Osipov 2019-07-17 15:33 ` [PATCH 4/5] decimal: add conversions to (u)int64_t Serge Petrenko 2019-07-24 16:17 ` Vladimir Davydov 2019-07-17 15:33 ` [PATCH 5/5] decimal: allow to index decimals Serge Petrenko 2019-07-24 16:56 ` Vladimir Davydov 2019-07-24 23:13 ` [tarantool-patches] " Konstantin Osipov 2019-07-24 23:17 ` Konstantin Osipov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=cover.1563376957.git.sergepetrenko@tarantool.org \ --to=sergepetrenko@tarantool.org \ --cc=tarantool-patches@freelists.org \ --cc=vdavydov.dev@gmail.com \ --subject='Re: [PATCH 0/5] Decimal indices' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox