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
The msgpack.v5 code located in msgpack_v5.go and
msgpack_v5_helper_test.go for tests. It is the same logic for
submodules.
An user can use msgpack.v5 with a build tag:
go_tarantool_msgpack_v5
Part of #124
@@ -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,30 @@ 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 (except at least `EncodeInt`, `EncodeUint` and `RegisterExt`).
160
+
But there are a lot of changes in a logic of encoding and deconding. On the plus
161
+
side the migration seems easy, but on the minus side you need to be very
162
+
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`. The change makes manual type conversions much more difficult and can
170
+
lead to runtime erros with an old code. We recommend not use type conversions
171
+
and give preference to `*Typed` functions (besides, it's faster).
172
+
173
+
There are also changes in the logic that can lead to errors in the old code,
174
+
[as example](https://github.com/vmihailenco/msgpack/issues/327). Although in
175
+
`msgpack.v5` has added some functions for the logic tuning see
176
+
[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, but it is still impossible
177
+
to achieve full compliance of behavior between `msgpack.v5` and `msgpack.v2`. So
178
+
we don't go this way. We use standart settings if it possible.
179
+
147
180
## Contributing
148
181
149
182
See [the contributing guide](CONTRIBUTING.md) for detailed instructions on how
0 commit comments