Skip to content

Commit c2498be

Browse files
lockeroleg-jukovec
authored andcommitted
queue: encode UUID argument of identify() as string instead of binary
The identify() function expects the UUID argument to be a plain string while the go connector encodes it in MsgPack as a binary blob (MP_BIN). This works fine for now because Tarantool stores MP_BIN data in a string when decoded to Lua but this behavior is going to change soon: we're planning to introduce the new Lua type for binary data and update the MsgPack decoder to store MP_BIN data in a varbianry object instead of a plain string. Let's prepare for that by converting the UUID data to a string before encoding. Needed for tarantool/tarantool#1629
1 parent 4f9b161 commit c2498be

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
1919
- connection_pool renamed to pool (#239)
2020
- Use msgpack/v5 instead of msgpack.v2 (#236)
2121
- Call/NewCallRequest = Call17/NewCall17Request (#235)
22+
- Change encoding of the queue.Identify() UUID argument from binary blob to
23+
plain string. Needed for upgrade to Tarantool 3.0, where a binary blob is
24+
decoded to a varbinary object (#313).
2225

2326
### Deprecated
2427

queue/queue.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ func (q *queue) Identify(u *uuid.UUID) (uuid.UUID, error) {
239239
if bytes, err := u.MarshalBinary(); err != nil {
240240
return uuid.UUID{}, err
241241
} else {
242-
args = []interface{}{bytes}
242+
args = []interface{}{string(bytes)}
243243
}
244244
}
245245

0 commit comments

Comments
 (0)