forked from fl00r/go-tarantool-1.6
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Labels
needs feedbackSomething is unclear with the issueSomething is unclear with the issuequestionFurther information is requestedFurther information is requested
Description
Reproducer
- We launch a cluster with Cartridge and the role of crud. This is an example, any cluster on a tarantula will do.
- Execute the command, for example,
crud.replace, orcrud.insertor any.
func (Tarantool) Call(conn *tarantool.Connection, fnName string, args interface{}) *tarantool.Response {
req := tarantool.NewCallRequest(fnName).Args(args)
resp, err := conn.Do(req).Get()
if err != nil { /* ... */ }
return resp
}
Call("localhost:3301", "crud.replave_object_many", args)Output:
{
"request_id": 104,
"code": 0,
"error": "",
"data": [
{},
null
],
"pos": [],
"meta_data": [],
"sql_info": {
"affected_count": 0,
"info_autoincrement_ids": []
}
}
Pay attention to field data - it contains two elements - result and error. Error = null, it's right. In data = void struct - it's not right.
In fact, there is an answer like:
crud.replace('customers', {1, box.NULL, 'Alice', 22})
---
- metadata:
- {'name': 'id', 'type': 'unsigned'}
- {'name': 'bucket_id', 'type': 'unsigned'}
- {'name': 'name', 'type': 'string'}
- {'name': 'age', 'type': 'number'}
rows:
- [1, 477, 'Alice', 22]
...
Specifically in this:
fmt.Sprintf("%+v", resp.Data[0])
map[metadata:[map[name:id type:unsigned] map[name:bucket_id type:unsigned] map[name:data type:any]] rows:[[993 13802 map[array:[a a 1] bool:true dec:934.22452070173 map:map[key:i] num:88152273 str:bqak time:2017-02-19T03:52:56Z uuid:e71c27b5-db75-4609-ad29-bb46b0836e85]] [994 10883 map[array:[1 a a 1] bool:true dec:858.5405680067324 map:map[key:t q] num:247090 str:sw jqtk time:2017-02-06T17:41:30Z uuid:bf1abe5c-17dc-42d7-9d06-97c60ab61a7d]] [997 10519 map[array:[a false a] bool:true dec:161.62182397534568 map:map[key:rczsroe] num:1711937 str: vpex time:2011-05-02T16:29:02Z uuid:d639d2b2-b0ac-46f4-85fb-42ec1a708a19]] [998 7619 map[array:[1 a 1 a] bool:true dec:890.2226166378725 map:map[key:nlb] num:6394776 str:skxbcf time:2022-01-15T02:05:51Z uuid:8baed496-e3d5-44af-b86d-1ee9dfa7dddd]] [1000 2603 map[array:[1 1 false false false] bool:true dec:512.2494938106767 map:map[key:jfkfgl] num:8154636 str:aatpyea time:2003-03-15T19:11:38Z uuid:7a195b9d-d64b-4609-89d0-6f9d81cd8ab7]] [991 20703 map[array:[false 1 1] bool:true dec:359.77481609979964 map:map[key:up] num:69933998 str:vsxc time:2020-06-12T18:15:26Z uuid:557cea2b-0e5d-4fe5-bd42-4cec3fc46ab2]] [992 28219 map[array:[false 1 1 a a] bool:true dec:761.0353213689805 map:map[key:sp] num:18936014 str:th qsn time:2008-01-01T11:18:41Z uuid:aaf16870-80db-43a0-8460-484611562b72]] [995 27522 map[array:[false a 1 false false] bool:true dec:591.9781213667983 map:map[key:hjx] num:76513196 str:phdzrvu time:2003-12-16T06:58:52Z uuid:f2ac2140-78e5-46d6-998a-8bd6442749a3]] [996 28742 map[array:[a a false a 1] bool:true dec:866.1781417547014 map:map[key:du] num:84725520 str:jadyuot time:2006-10-23T05:28:45Z uuid:14573105-b0d4-40b9-aa99-73987dd74ff0]] [999 21026 map[array:[a 1 1 false] bool:true dec:140.08652467167707 map:map[key:njwqc] num:59971393 str:jmit t time:2022-08-13T08:06:38Z uuid:702f103c-9946-42bd-8d8e-7927d8e7ccd6]]]]
Problem
The problem is that the field names in the response are written in lowercase letters. Thus, these are private fields and we do not have access to them. Therefore, in the end we see an empty response, although it is not empty.
Metadata
Metadata
Assignees
Labels
needs feedbackSomething is unclear with the issueSomething is unclear with the issuequestionFurther information is requestedFurther information is requested