Description
To repro
- execute
cbq> FLUSH COLLECTION default; |
result in following error:
{
|
"code": 5001, |
"msg": "Panic: runtime error: invalid memory address or nil pointer dereference", |
"query": "flush collection default" |
From query.log
2021-12-13T15:23:16.137-08:00 [SEVERE] panic: runtime error: invalid memory address or nil pointer dereference |
2021-12-13T15:23:16.137-08:00 [SEVERE] request text: <ud>flush collection default</ud> |
2021-12-13T15:23:16.137-08:00 [SEVERE] query context: <ud></ud> |
2021-12-13T15:23:16.137-08:00 [SEVERE] stack: goroutine 2732 [running]: |
github.com/couchbase/query/server.(*Server).serviceRequest.func1(0x28c6cd8, 0xc000b5b900, 0xc000176000) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/server/server.go:957 +0xc6 |
panic(0x22e7da0, 0x37b6960) |
/home/couchbase/.cbdepscache/exploded/x86_64/go-1.16.6/go/src/runtime/panic.go:965 +0x1b9 |
github.com/couchbase/query/algebra.(*Path).string(0x0, 0xc001b20000, 0x10, 0xc00160b200) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/algebra/path.go:210 +0x26 |
github.com/couchbase/query/algebra.(*Path).FullName(...)
|
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/algebra/path.go:193 |
github.com/couchbase/query/algebra.(*FlushCollection).Privileges(0xc001a84c80, 0x24710a0, 0xc001b2b590, 0x286f098) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/algebra/collection_flush.go:88 +0xb4 |
github.com/couchbase/query/planner.Build(0x286cb38, 0xc001a84c80, 0x2880048, 0xc00033c1c0, 0x2880378, 0xc00000e318, 0x25e82a7, 0x7, 0x2520100, 0xc001092780, ...) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build.go:42 +0x288 |
github.com/couchbase/query/planner.BuildPrepared(0x286cb38, 0xc001a84c80, 0x2880048, 0xc00033c1c0, 0x2880378, 0xc00000e318, 0x25e82a7, 0x7, 0x100, 0xc001092780, ...) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_prepared.go:19 +0xc5 |
github.com/couchbase/query/server.(*Server).getPrepared(0xc000176000, 0x28c6cd8, 0xc000b5b900, 0xc0000e4500, 0x2843ed0, 0x3a2dd00, 0x287ae80) |
/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/server/server.go:1208 +0x11fe |
github.com/couchbase/query/server.(*Server).serviceRequest(0xc000176000, 0x28c6cd8, 0xc000b5b900) |