Details
-
Bug
-
Resolution: Fixed
-
Test Blocker
-
Cheshire-Cat, Neo
-
*Location*: https://docs.couchbase.com/server/current/getting-started/try-a-query.html
*Referrer*: https://docs.couchbase.com/server/current/getting-started/look-at-the-results.html
*User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36
*Screen Resolution*: 2560 x 1440*Location*: https://docs.couchbase.com/server/current/getting-started/try-a-query.html *Referrer*: https://docs.couchbase.com/server/current/getting-started/look-at-the-results.html *User-Agent*: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 *Screen Resolution*: 2560 x 1440
-
DOC-2022-S14, DOC-2022-S15
Description
The "Run your first N1QL query" tutorial has the below line:
\SET -query_context 'travel-sample.inventory';
|
But setting it in CBQ and then running a query fails with a keyspace not found error:
cbq> \SET -query_context 'travel-sample.inventory';
|
cbq> SELECT a.country FROM airline a WHERE a.name = "Excel Airways";
|
{
|
"requestID": "83a0a47b-5133-4b60-bf35-85bc0433984e",
|
"errors": [
|
{
|
"code": 12003,
|
"msg": "Keyspace not found in CB datastore: default:'travel-sample - cause: No bucket named 'travel-sample"
|
}
|
],
|
"status": "fatal",
|
"metrics": {
|
"elapsedTime": "23.770629ms",
|
"executionTime": "23.65818ms",
|
"resultCount": 0,
|
"resultSize": 0,
|
"serviceLoad": 4,
|
"errorCount": 1
|
}
|
}
|
The correct syntax doesn't have the apostrophes:
cbq> \SET -query_context travel-sample.inventory;
|
cbq> SELECT a.country FROM airline a WHERE a.name = "Excel Airways";
|
{
|
"requestID": "ef4df5b2-fdbf-4a50-a1d3-7ec94ea92f74",
|
"signature": {
|
"country": "json"
|
},
|
"results": [
|
{
|
"country": "United Kingdom"
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "15.97345ms",
|
"executionTime": "15.861355ms",
|
"resultCount": 1,
|
"resultSize": 43,
|
"serviceLoad": 4
|
}
|
}
|
Reporter: Daniel Thole
E-mail: daniel.thole@couchbase.com