Go client read LDT blob not expected

Hi,

I have stored some data with binary field “v” in a LDT bin:

aql> execute llist.scan(data) on test.geoIdx where PK='3324' 
[{"v":0A 04 33 33 32 34 11 25 00 40 55 55 55 55 87 1A 02 63 31 20 CC AE E4 A8 05 28 D0 AE E4 A8 05, "key":"WpKKKKK--14"}, {"v":0A 04 33 33 32 34 11 0D 02 40 55 55 55 55 87 1A 02 63 32 20 CD AE E4 A8 05 28 D2 AE E4 A8 05, "key":"WpKKKKK--VC"}]

However, using Go client, I read back different value at “v” field. It’s type is byte which is correct. But somehow the byte slice is not what I have in db. (note here is in decimal but above is in hex). Anything I missed about reading binary from db? Thanks.

client.Execute(nil, key, "llist", "scan", asc.NewStringValue("data"))
Got: [map[key:WpKKKKK--14 v:[0 0 0 0 0 1 0 0 0 4 0 109 111 111 0 0 0 7 1 103 101 111 73 100 120 0 0 0 21 4 110]] map[v:[105 115 116 0 0 0 6 31 114 97 110 103 101 0 0 0 37 32 147 168 3 99 104 97 116 73 100 120 172 3 74] key:WpKKKKK--VC]]

After half day’s debugging, it turns out to be a bug in the Go client. In summary the returned “v” field (typed byte) points to a buffer that is returned to pool after the client.Execute() command finishes.

I’ve filed it in github. I am not very familiar with the code base so I’d expect the repo’s owner can have a better fix.

Hi, thanks for your report and finding the fix. Sorry for the relatively late reply, we live in different timezones.

I’ll release a new client with the fix today.

1 Like

No problem, thanks for the quick fix!

This was fixed in Go v1.4.1.

1 Like