Details
Description
Issue
The application hangs when executing a N1QL Parameterized prepared query when adhoc is set to false.
Reproduction
This is the prepared statement executed through the Query Workbench:
prepare ps_test as select * from `travel-sample` where id = $id
This is the code (snippet)
JsonObject placeholderValues = JsonObject.create().put("id", 10); |
N1qlQuery hangQueryParameterized = N1qlQuery.parameterized("execute ps_test", |
placeholderValues,N1qlParams.build().consistency(ScanConsistency.REQUEST_PLUS).adhoc(false)); |
N1qlQueryResult queryResultParameterized = bucket.query(hangQueryParameterized);
|
for (N1qlQueryRow row : queryResultParameterized) { |
System.out.println(row);
|
}
|
... hangs
Right usage
Setting adhoc(true) in code snippet is the right usage. Here is the completed_requests:
{
|
"completed_requests": { |
"elapsedTime": "7.027909111s", |
"errorCount": 0, |
"node": "10.111.170.101:8091", |
"phaseCounts": { |
"fetch": 31591, |
"primaryScan": 31591 |
},
|
"phaseOperators": { |
"authorize": 1, |
"fetch": 1, |
"primaryScan": 1 |
},
|
"preparedName": "ps_test", |
"preparedText": "prepare ps_test as select * from `travel-sample` where id = $id", |
"remoteAddr": "10.111.170.1:58164", |
"requestId": "da5f63fe-5c61-44c6-ae0b-0a9157988a7d", |
"requestTime": "2018-02-14 00:02:29.477282904 +0000 UTC", |
"resultCount": 1, |
"resultSize": 138, |
"scanConsistency": "scan_plus", |
"serviceTime": "7.027839477s", |
"state": "completed", |
"statement": "execute ps_test", |
"userAgent": "couchbase-java-client/2.5.3 (git: 2.5.3, core: 1.5.3) (Mac OS X/10.13.3 x86_64; Java HotSpot(TM) 64-Bit Server VM 1.8.0_144-b01)", |
"users": "test" |
}
|
},
|