Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.5.0
-
Untriaged
-
Unknown
Description
Build : 6.5.0-3633
Steps:
1. Setup a 1 node cluster with kv+query+index node
2. Beer-sample bucket installed.
3. Drop primary index and create the following secondary indexes:
4. create index idx1 on `beer-sample`(`type`,`name`)
5. create index idx2 on `beer-sample`(`name`)
6. Run select raw name from `beer-sample` where `type`="beer" limit 1 and ensure it runs.
7. Now create a function with the following definition:
create function getnames(typevar, lim) language inline as (select raw name from `beer-sample` where `type`=typevar limit lim)
8. Execute this function - execute function getnames("beer",1)
9. It results into a panic
[
]
The same function works if there is only primary index.
Stack Trace
_time=2019-07-11T13:43:51.530-07:00 _level=SEVERE _msg=panic: runtime error: invalid memory address or nil pointer dereference
|
_time=2019-07-11T13:43:51.530-07:00 _level=SEVERE _msg=request text: <ud>execute function getnames("beer", 1)</ud>
|
_time=2019-07-11T13:43:51.530-07:00 _level=SEVERE _msg=stack: goroutine 526889 [running]:
|
github.com/couchbase/query/execution.(*Context).Recover(0xc00e69bb00, 0x0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:598 +0xbc
|
panic(0x1c87860, 0x31104a0)
|
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.11.4/go/src/runtime/panic.go:513 +0x1b9
|
github.com/couchbase/query/expression.(*Identifier).Evaluate(0xc0561589c0, 0x0, 0x0, 0x20a9ae0, 0xc00e69bb00, 0xc063fdce78, 0xc4f142, 0xc060ef1bb0, 0xc063fdce98)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/expression/identifier.go:64 +0x22
|
github.com/couchbase/query/execution.evalLimitOffset(0x20d2b40, 0xc0561589c0, 0x0, 0x0, 0x7fffffffffffffff, 0x1, 0xc00e69bb00, 0x0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_util.go:68 +0x84
|
github.com/couchbase/query/execution.(*IndexScan3).scan(0xc00fa06b40, 0xc00e69bb00, 0xc054a77b00, 0x20c13e0, 0xc0467e02a0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_index3.go:178 +0x285
|
created by github.com/couchbase/query/execution.(*IndexScan3).RunOnce.func1
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_index3.go:76 +0x26b
|
|
goroutine 526889 [running]:
|
github.com/couchbase/query/execution.(*Context).Recover(0xc00e69bb00, 0x0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/context.go:598 +0xbc
|
panic(0x1c87860, 0x31104a0)
|
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.11.4/go/src/runtime/panic.go:513 +0x1b9
|
github.com/couchbase/query/expression.(*Identifier).Evaluate(0xc0561589c0, 0x0, 0x0, 0x20a9ae0, 0xc00e69bb00, 0xc063fdce78, 0xc4f142, 0xc060ef1bb0, 0xc063fdce98)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/expression/identifier.go:64 +0x22
|
github.com/couchbase/query/execution.evalLimitOffset(0x20d2b40, 0xc0561589c0, 0x0, 0x0, 0x7fffffffffffffff, 0x1, 0xc00e69bb00, 0x0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_util.go:68 +0x84
|
github.com/couchbase/query/execution.(*IndexScan3).scan(0xc00fa06b40, 0xc00e69bb00, 0xc054a77b00, 0x20c13e0, 0xc0467e02a0)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_index3.go:178 +0x285
|
created by github.com/couchbase/query/execution.(*IndexScan3).RunOnce.func1
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/execution/scan_index3.go:76 +0x26b
|
Attachments
For Gerrit Dashboard: MB-35007 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
113702,3 | MB-35007 select in function fails to take offset and limit from arguments | master | query | Status: MERGED | +2 | +1 |