Skip to content

Commit

Permalink
queue: encode UUID argument of identify() as string instead of binary
Browse files Browse the repository at this point in the history
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
  • Loading branch information
locker authored and oleg-jukovec committed Jun 27, 2023
1 parent 4f9b161 commit c2498be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
- connection_pool renamed to pool (#239)
- Use msgpack/v5 instead of msgpack.v2 (#236)
- Call/NewCallRequest = Call17/NewCall17Request (#235)
- Change encoding of the queue.Identify() UUID argument from binary blob to
plain string. Needed for upgrade to Tarantool 3.0, where a binary blob is
decoded to a varbinary object (#313).

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (q *queue) Identify(u *uuid.UUID) (uuid.UUID, error) {
if bytes, err := u.MarshalBinary(); err != nil {
return uuid.UUID{}, err
} else {
args = []interface{}{bytes}
args = []interface{}{string(bytes)}
}
}

Expand Down

0 comments on commit c2498be

Please sign in to comment.