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

(cherry picked from c2498be)
  • Loading branch information
locker authored and oleg-jukovec committed Aug 3, 2023
1 parent 403f2c3 commit 2aafc13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.

### Changed

- 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).

### Fixed

## [1.12.0] - 2023-06-07
Expand Down
2 changes: 1 addition & 1 deletion queue/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,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 2aafc13

Please sign in to comment.