Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH 0/5] Decimal indices
@ 2019-07-17 15:33 Serge Petrenko
  2019-07-17 15:33 ` [PATCH 1/5] decimal: fix decimal.round() when scale == 0 Serge Petrenko
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Serge Petrenko @ 2019-07-17 15:33 UTC (permalink / raw)
  To: vdavydov.dev; +Cc: tarantool-patches, Serge Petrenko

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)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-07-24 23:17 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 15:33 [PATCH 0/5] Decimal indices Serge Petrenko
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox