Closed Vlad97vsv closed 4 months ago
The error seems clear, but I can’t understand why tarantool returns 1 field when asking for length.
To be honest, it's more weird that every (or almost every) other method returns explicit result, nil
in case of success.
Thank you for the issue, are you sure that go-tarantool version is exactly v2.0.0? It should be fixed with: https://github.com/tarantool/go-tarantool/commit/c3ba5b59b7d1d7fdedba1e914925abe7d6b1c77d
Please, write a crud
version because I can’t reproduce the problem. It works fine for me:
// ExampleLenRequest demonstrates how to execute a LenRequest.
func ExampleLenRequest() {
conn := exampleConnect()
req := crud.MakeLenRequest(exampleSpace)
ret := crud.LenResult{}
if err := conn.Do(req).GetTyped(&ret); err != nil {
fmt.Printf("Failed to execute request: %s", err)
return
}
fmt.Println(ret.Value)
// Output:
// 4
}
Please, make sure that go-tarantool version is release and v2.0.0 at least (or you could use v2.1.0 to make sure).
I use github.com/tarantool/go-tarantool/v2 v2.0.0-20230823074441-d8df65dcd0f2
.
Thank you. I'll try to update to 2.1.0 and will be back with feedback
With the update to version 2.1.0 the problem disappeared.
Thank you very much for the quick response
Can't get space length via crud.len
I get an error:
array len doesn't match: 1
db - is connected ConnectionPool
>>> panic: array len doesn't match: 1
When I use Count query everything is ok.
If you look at what arrives, you can see that only 1 entry in the array arrives for crud.len. And for count there are 2 entries:
The error occurs precisely during serialization. Therefore the code below works
Crud is installed, everything works correctly via tarantoolctl crud.len works.
The error seems clear, but I can’t understand why tarantool returns 1 field when asking for length.
golang version: 1.21.1 lib: go-tarantool/v2 2.0.0 OS: MacOs tarantool version: 2.11