Select with Like Error

cbq-engine has stop with Like query after create index

sample
create index name on sample(name)

select name from sample where like name like ‘%test%’

Hi,

Can you restart cbq-engine and issue the following query:

select name from sample where name like ‘%test%’

You had 2 “likes” in your initial post.

If you still see a crash, please file a bug at http://www.couchbase.com/issues/browse/MB/component/10718

Is this a bug? I am also facing the same issue. I tried the following -

SELECT name
FROM beer-sample
WHERE name LIKE ‘21%’ // This works

SELECT name
FROM beer-sample
WHERE name LIKE ‘%21’ // Fails

This issue is seen only when I connect to a couch instance using the cbq-engine. When I use the tutorial data that came with the N1QL sample, it works all fine.

This is a bug which has been fixed in DP4. DP4 will be released next week.

Note: In DP4, you will need to escape `beer-sample` in back ticks, because of the hyphen.

Thanks.

DP4: http://blog.couchbase.com/n1ql-dp4-is-here

I downloaded the DP4. I am able to run it.

D:\TFS\N1QL Engine\couchbase-query_dev_preview4>cbq-engine -datastore http://localhost:8091
_time=“2015-01-28T00:34:42-05:00” _level=“INFO” _msg=“New site created with url http://localhost:8091
_time=“2015-01-28T00:34:42-05:00” _level=“INFO” _msg=“cbq-engine started” datastore=“http://localhost:8091” version=“cbq-dp4”
_time=“2015-01-28T00:35:42-05:00” _level=“INFO” _msg=“Refreshing pool default”


After that when I issued the below N1Ql query,

SELECT name FROM beer-sample

I got the below exception

500: Internal Server Error

{
“requestID”: “3a33ab13-307b-4fef-8431-5873e31c5ed8”,
“errors”: [
{
“code”: 5000,
“msg”: “syntax error”
}
],
“status”: “fatal”,
“metrics”: {
“elapsedTime”: “0”,
“executionTime”: “0”,
“resultCount”: 0,
“resultSize”: 0,
“errorCount”: 1
}
}

Please use back ticks around `beer-sample`

It worked thanks!

One more quick question. I dont need the Default bucket. Is it fine to delete that? or it may cause some issue later on.

Thanks

Just keep it :smile: