[PATCH 0/3] decimal. Add internal methods to encode/decode decimals to msgpack.

Serge Petrenko sergepetrenko at tarantool.org
Fri Jun 21 12:02:04 MSK 2019


https://github.com/tarantool/tarantool/issues/692
https://github.com/tarantool/tarantool/tree/sp/gh-692-mp-decimal-new

This patchset add the methods necessary to encode/decode decimals as msgpack.
The methods have the similar API to the existing mp methods:
mp_encode_.../mp_decode_...

The first patch updates the msgpuck library to introduce EXT types.
The second path fixes a couple of places in decimal_pack() and decimal_len()
nethods, where const qualifiers were forgotten.
The third patch adds the new methods: mp_encode_decimal(), mp_decode_decimal()
and mp_sizeof_decimal(), and updates the decimal unit test to test them.


Serge Petrenko (3):
  lib: update msgpuck library
  decimal: add const qualifiers for decimal_pack() and decimal_len()
  decimal: allow to encode/decode decimals as MsgPack

 src/lib/core/CMakeLists.txt  |   1 +
 src/lib/core/decimal.c       |   4 +-
 src/lib/core/decimal.h       |   4 +-
 src/lib/core/mp_decimal.c    |  72 ++++++
 src/lib/core/mp_decimal.h    |  62 +++++
 src/lib/core/mp_user_types.h |  38 +++
 src/lib/msgpuck              |   2 +-
 test/unit/decimal.c          |  33 ++-
 test/unit/decimal.result     | 476 ++++++++++++++++++++++++----------
 test/unit/msgpack.result     | 480 ++++++++++++++++++++++++++++++++++-
 10 files changed, 1014 insertions(+), 158 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

-- 
2.20.1 (Apple Git-117)




More information about the Tarantool-patches mailing list