Skip to content

Describe how decimals are encoded in the binary protocol #992

Closed
@Totktonada

Description

@Totktonada

The encoding was introduced in this commit. The information how decimals are encoded in the binary protocol is important for connectors developers.

Cited from the commit message:

The decimal MsgPack representation looks like this:
+--------+-------------------+------------+===============+
| MP_EXT | length (optional) | MP_DECIMAL | PackedDecimal |
+--------+-------------------+------------+===============+

MsgPack spec defines fixext 1/2/4/8/16 and ext 8/16/32 types. fixext types have fixed length, so it is not encoded explicitly, while ext types require to encode a data length. MP_EXP + optional length meant usage of one of those types.

MP_DECIMAL is 1.

I don't know how exactly PackedDecimal is encoded. @sergepetrenko, can you share more info?

Metadata

Metadata

Assignees

Labels

featureA new functionalityreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions