Description
In 3.2.0 the code for lcb_CMDQUERY_::option_array (called by lcb_cmdquery_positional_param) now makes the following check:
if (json_value.type() != Json::ValueType::arrayValue) { |
return LCB_ERR_INVALID_ARGUMENT; |
}
|
I do not think the parameter has to be an array (the documentation - https://docs.couchbase.com/sdk-api/couchbase-c-client/group__lcb-n1ql-api.html#ga6ff035fe7dee2bc0171d318f5fe4c6c1- does not require it). Furthermore, the example given in 3.2.0 documentation itself does not use an array (see https://docs.couchbase.com/sdk-api/couchbase-c-client/example_2minimal_2query_8c-example.html#a26):
const char *param = "\"African Swallows\""; |
lcb_cmdquery_create(&cmd);
|
|
snprintf(query, sizeof(query), "SELECT * FROM `%s` WHERE $1 in interests LIMIT 1", bucket); |
check(lcb_cmdquery_statement(cmd, query, strlen(query)), "set QUERY statement"); |
check(lcb_cmdquery_positional_param(cmd, param, strlen(param)), "set QUERY positional parameter"); |
Or do I misunderstand something?
As usual, thanks a lot.
Attachments
Issue Links
- duplicates
-
CCBC-1429 Fix Positional Params (Query & Analytics)
- Resolved