[PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack

Konstantin Osipov kostja at tarantool.org
Tue Aug 13 00:29:05 MSK 2019


* Serge Petrenko <sergepetrenko at tarantool.org> [19/08/08 15:01]:
> This patch adds the methods necessary to encode and decode decimals to
> MsgPack. MsgPack EXT type (MP_EXT) together with a new extension type
> MP_DECIMAL is used as a record header.
> 
> The decimal MsgPack representation looks like this:
> +--------+-------------------+------------+===============+
> | MP_EXT | length (optional) | MP_DECIMAL | PackedDecimal |
> +--------+-------------------+------------+===============+
> The whole record may be encoded and decoded with
> mp_encode_decimal() and mp_decode_decimal(). This is equivalent to
> performing mp_encode_extl()/mp_decode_extl() on the first 3 fields and
> decimal_pack/unpack() on the PackedDecimal field.
> 
> It is also possible to decode and encode decimals to msgpack from lua,
> which means you can insert decimals into spaces, but only into unindexed
> fields for now.

I like that this commit consolidates mp encode/decode and decimal
in a separate file, but I don't see it remove dependency on
messagepack from decimal.h|c

 

-- 
Konstantin Osipov, Moscow, Russia



More information about the Tarantool-patches mailing list