Tarantool development patches archive
 help / color / mirror / Atom feed
* [PATCH v3 0/6] Decimal indices
@ 2019-08-20 17:09 Serge Petrenko
  2019-08-20 17:09 ` [PATCH v3 1/6] lua: fix decimal comparison with nil Serge Petrenko
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Serge Petrenko @ 2019-08-20 17:09 UTC (permalink / raw)
  To: vdavydov.dev, kostja; +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 store decimals in spaces and to build indices
over them. As a prerequisite, the ability to encode and decode decimals as
msgpack is also added to both C and Lua modules.

First three patches contain various bugfixes found during the work on the issue.

The sixth patch adds the methods to encode and decode decimals as msgpack, and
expands lua msgpack and msgpackffi modules with the same abilities.
This allows to store decimal values in tuples, and in space unindexed fields.

The seventh patch adds methods to cast decimals to 64 bit integers. This
functionality is needed to calculate comparison hints from decimals in scope of
patch 8.

Patch 8 finally introduces decimal fields, adds comparators for decimal values
and defines field types appropriate for storing decimals.

Changes in v3:
  - minor fixes as per review by Kostja
    and Vladimir.
  - Remove patches introducing the new
    enum mp_field_type (patches 4 & 5 previously)
  - Basically return to v1 with some additional
    review fixes and better checks for MP_EXT
    subtypes in patch 6

Changes in v2:
  - Various minor fixes regarding a review by
    Vladimir Davydov
  - All the bugfixes are extracted into separate
    patches
  - More tests are added to cover space.format and
    index.alter with decimal fields
  - A single enum is introduced to cover both existent
    msgpack types and the ones with which we might
    come up later
  - The patches covering the ability to encode/decode
    decimals as msgpack in C and Lua are squashed.

Serge Petrenko (6):
  lua: fix decimal comparison with nil
  decimal: fix encoding numbers with positive exponent.
  lua/pickle: fix a typo
  decimal: allow to encode/decode decimals as MsgPack
  decimal: add conversions to (u)int64_t
  decimal: allow to index decimals

 extra/exports                        |   4 +
 src/box/field_def.c                  |  45 +-
 src/box/field_def.h                  |  23 +-
 src/box/key_def.h                    |   3 +-
 src/box/tuple_compare.cc             | 198 +++++++-
 src/box/tuple_format.c               |   3 +-
 src/lib/core/CMakeLists.txt          |   1 +
 src/lib/core/decimal.c               |  99 +++-
 src/lib/core/decimal.h               |  27 +
 src/lib/core/mp_decimal.c            |  72 +++
 src/lib/core/mp_decimal.h            |  70 +++
 src/lib/core/mp_extension_types.h    |  47 ++
 src/lib/core/mpstream.c              |  11 +
 src/lib/core/mpstream.h              |   4 +
 src/lua/decimal.c                    |  23 +-
 src/lua/decimal.h                    |   7 +
 src/lua/msgpack.c                    |  53 +-
 src/lua/msgpackffi.lua               |  38 ++
 src/lua/pickle.c                     |   4 +-
 src/lua/utils.c                      |  16 +-
 src/lua/utils.h                      |   8 +-
 test/app-tap/lua/serializer_test.lua |  14 +
 test/app-tap/msgpackffi.test.lua     |   3 +-
 test/app/decimal.result              | 172 ++++---
 test/app/decimal.test.lua            |   8 +
 test/app/msgpack.result              |  41 ++
 test/app/msgpack.test.lua            |  15 +
 test/app/pack.result                 |   8 +
 test/app/pack.test.lua               |   2 +
 test/box/tuple.result                |  85 ++++
 test/box/tuple.test.lua              |  23 +
 test/engine/ddl.result               |  85 +++-
 test/engine/ddl.test.lua             |  40 +-
 test/engine/decimal.result           | 356 +++++++++++++
 test/engine/decimal.test.lua         | 104 ++++
 test/engine/iterator.result          | 730 +++++++++++++++++++++++++++
 test/engine/iterator.test.lua        |  22 +
 test/unit/decimal.c                  | 139 ++++-
 test/unit/decimal.result             | 283 ++++++++++-
 third_party/decNumber                |   2 +-
 third_party/lua-cjson/lua_cjson.c    |  12 +-
 third_party/lua-yaml/lyaml.cc        |  10 +-
 42 files changed, 2764 insertions(+), 146 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_extension_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] 14+ messages in thread

end of thread, other threads:[~2019-08-22 10:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-20 17:09 [PATCH v3 0/6] Decimal indices Serge Petrenko
2019-08-20 17:09 ` [PATCH v3 1/6] lua: fix decimal comparison with nil Serge Petrenko
2019-08-21 14:13   ` Vladimir Davydov
2019-08-20 17:10 ` [PATCH v3 2/6] decimal: fix encoding numbers with positive exponent Serge Petrenko
2019-08-21 14:13   ` Vladimir Davydov
2019-08-20 17:10 ` [PATCH v3 3/6] lua/pickle: fix a typo Serge Petrenko
2019-08-21 14:13   ` Vladimir Davydov
2019-08-20 17:10 ` [PATCH v3 4/6] decimal: allow to encode/decode decimals as MsgPack Serge Petrenko
2019-08-21 15:02   ` Vladimir Davydov
2019-08-20 17:10 ` [PATCH v3 5/6] decimal: add conversions to (u)int64_t Serge Petrenko
2019-08-21 15:02   ` Vladimir Davydov
2019-08-20 17:10 ` [PATCH v3 6/6] decimal: allow to index decimals Serge Petrenko
2019-08-21 15:02   ` Vladimir Davydov
2019-08-22 10:33   ` [tarantool-patches] " Kirill Yukhin

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