Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-52476

Check query val pointer contents before de-referencing

    XMLWordPrintable

Details

    • Untriaged
    • 1
    • Yes

    Description

      https://forums.couchbase.com/t/n1ql-search-clause-with-named-parameter-results-in-runtime-error/33749/7

       

      This can occur when named parameters are used with non-dynamic index mappings.

      github.com/couchbase/query/server.(*Server).serviceRequest.func1(0x1e5a1a8, 0xc001e4a000, 0xc0000b8400)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/server/server.go:958 +0xc6
      panic(0x18ac700, 0x2cb9ad0)
      	/home/couchbase/.cbdepscache/exploded/x86_64/go-1.16.6/go/src/runtime/panic.go:965 +0x1b9
      github.com/couchbase/n1fty.(*FTSIndex).buildQueryAndCheckIfSargable(0xc000989380, 0x0, 0x0, 0x0, 0x0, 0x1e16b20, 0xc002b471d0, 0x0, 0x0, 0xc0017d75e0)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/n1fty/index.go:685 +0xb56
      github.com/couchbase/n1fty.(*FTSIndex).Sargable(0xc000989380, 0x0, 0x0, 0x1e1f9d8, 0xc000b35ac0, 0x1e2eab8, 0xc000b35dc0, 0x0, 0x0, 0x0, ...)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/n1fty/index.go:415 +0x10c
      github.com/couchbase/query/planner.(*builder).sargableSearchIndexes(0xc0024403c0, 0xc000a63000, 0xe, 0x100, 0x1e353c8, 0xc0003c22d0, 0xc000c61950, 0xc0017d7a40, 0xc001b63e60, 0x1, ...)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan_search.go:292 +0x6b6
      github.com/couchbase/query/planner.(*builder).buildTermScan(0xc0024403c0, 0xc000ead100, 0xc0009d80f0, 0x1e28d30, 0xc003cdea20, 0xc000a63000, 0xe, 0x100, 0xc001b63e60, 0x1, ...)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan.go:394 +0x1465
      github.com/couchbase/query/planner.(*builder).buildSubsetScan(0xc0024403c0, 0x1e11298, 0xc0001c44e0, 0xc000ead100, 0xc0009d80f0, 0x1e28d30, 0xc003cdea20, 0xc000a63000, 0xe, 0x100, ...)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan.go:291 +0x1f4
      github.com/couchbase/query/planner.(*builder).buildPredicateScan(0xc0024403c0, 0x1e11298, 0xc0001c44e0, 0xc000ead100, 0xc0009d80f0, 0x1e28d30, 0xc003cdea20, 0x0, 0x0, 0x0, ...)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan.go:240 +0x38d
      github.com/couchbase/query/planner.(*builder).buildScan(0xc0024403c0, 0x1e11298, 0xc0001c44e0, 0xc000ead100, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan.go:163 +0x879
      github.com/couchbase/query/planner.(*builder).selectScan(0xc0024403c0, 0x1e11298, 0xc0001c44e0, 0xc000ead100, 0x0, 0x0, 0xc000c62188, 0xaa890a, 0xc000ead680)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_scan.go:52 +0x3b8
      github.com/couchbase/query/planner.(*builder).VisitKeyspaceTerm(0xc0024403c0, 0xc000ead100, 0x203000, 0x203000, 0x0, 0x3000106)
      	/home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/planner/build_select_from.go:255 +0x185
      github.com/couchbase/query/algebra.(*KeyspaceTerm).Accept(...) 

      Attachments

        Issue Links

          Activity

            People

              ajay.bhullar Ajay Bhullar
              abhinav Abhi Dangeti
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                PagerDuty