From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 13 Aug 2019 00:29:05 +0300 From: Konstantin Osipov Subject: Re: [PATCH v2 6/8] decimal: allow to encode/decode decimals as MsgPack Message-ID: <20190812212905.GH32337@atlas> References: <820cab72f09d48cf2d9e9cba5e0bba9620e32d96.1565263272.git.sergepetrenko@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <820cab72f09d48cf2d9e9cba5e0bba9620e32d96.1565263272.git.sergepetrenko@tarantool.org> To: Serge Petrenko Cc: vdavydov.dev@gmail.com, tarantool-patches@freelists.org List-ID: * Serge Petrenko [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