You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -68,7 +69,15 @@ This allows us to introduce new features without losing backward compatibility.
68
69
go_tarantool_call_17
69
70
```
70
71
**Note:** In future releases, `Call17` may be used as default `Call` behavior.
71
-
3. To run fuzz tests with decimals, you can use the build tag:
72
+
3. To replace usage of `msgpack.v2` with `msgpack.v5`, you can use the build
73
+
tag:
74
+
```
75
+
go_tarantool_msgpack_v5
76
+
```
77
+
**Note:** In future releases, `msgpack.v5` may be used by default. We recommend
78
+
to read [msgpack.v5 migration notes](#msgpackv5-migration) and try to
79
+
use msgpack.v5 before the changes.
80
+
4. To run fuzz tests with decimals, you can use the build tag:
72
81
```
73
82
go_tarantool_decimal_fuzzing
74
83
```
@@ -144,6 +153,31 @@ There are two parameters:
144
153
* a space number (it could just as easily have been a space name), and
145
154
* a tuple.
146
155
156
+
### msgpack.v5 migration
157
+
158
+
Most function names and argument types in `msgpack.v5` and `msgpack.v2`
159
+
have not changed (in our code, we noticed changes in `EncodeInt`, `EncodeUint`
160
+
and `RegisterExt`). But there are a lot of changes in a logic of encoding and
161
+
decoding. On the plus side the migration seems easy, but on the minus side you
162
+
need to be very careful.
163
+
164
+
First of all, `EncodeInt8`, `EncodeInt16`, `EncodeInt32`, `EncodeInt64`
165
+
and `EncodeUint*` analogues at `msgpack.v5` encode numbers as is without loss of
166
+
type. In `msgpack.v2` the type of a number is reduced to a value.
167
+
168
+
Secondly, a base decoding function does not convert numbers to `int64` or
169
+
`uint64`. It converts numbers to an exact type defined by MessagePack. The
170
+
change makes manual type conversions much more difficult and can lead to
171
+
runtime errors with an old code. We do not recommend to use type conversions
172
+
and give preference to `*Typed` functions (besides, it's faster).
173
+
174
+
There are also changes in the logic that can lead to errors in the old code,
175
+
[as example](https://github.com/vmihailenco/msgpack/issues/327). Although in
176
+
`msgpack.v5` some functions for the logic tuning were added (see
177
+
[UseLooseInterfaceDecoding](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5#Decoder.UseLooseInterfaceDecoding), [UseCompactInts](https://pkg.go.dev/github.com/vmihailenco/msgpack/v5#Encoder.UseCompactInts) etc), it is still impossible
178
+
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
179
+
we don't go this way. We use standart settings if it possible.
180
+
147
181
## Contributing
148
182
149
183
See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how
0 commit comments