Description
Product: Tarantool
Since:
Root document: https://www.tarantool.io/en/doc/latest/dev_guide/internals/msgpack_extensions/
SME: @ ImeevMA
Details
MsgPack extension type MP_INTERVAL was created to serialize values of
struct interval.
Description of serialized value:
|MP_EXT|Size of packed interval|MP_INTERVAL|packed interval|
Packed interval - packed number of non-zero fields and packed non-null
fields. Each packed field consists of two packed integer values - the
field ID and its value. The number of non-null fields can be zero, in
which case packed interval
will be just packed integer 0
.
List of IDs:
0 - year
1 - month
2 - week
3 - day
4 - hour
5 - minute
6 - second
7 - nanosecond
8 - adjust
Example of packed interval value:
|C7|09|06|03|00|01|01|CCC8|03|D0B3|
Where
C7 - MP_EXT;
09 - size of packed interval value, 9 bytes;
06 - MP_INTERVAL;
03 - number of non-zero fields;
00 - ID of field year
;
01 - packed value 1
;
01 - ID of field month
;
CCC8 - packed value 200
;
03 - ID of field day
;
D0B3 - packed value -77
.
From there we can see, that the packed interval is actually
1 year, 200 months and -77 days
.
Requested by @ImeevMA in tarantool/tarantool@ed86174.