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

filter non aggregate error panic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 7.6.0, 7.2.4
    • 7.6.0, 7.2.4
    • query
    • 7.6.0-1318
    • Untriaged
    • 0
    • Unknown

    Description

      To repro

      • install travel-sample
      • select name, array_max(reviews[*].ratings[*].Location) FILTER (WHERE city = 'Paris') from `travel-sample` where type = 'hotel';

       cbq> select name, array_max(reviews[*].ratings[*].Location) FILTER (WHERE city = 'Paris') from `travel-sample` where type = 'hotel'
         > ;
      {
          "requestID": "8f1cb952-4155-45c5-a548-da1e948f6320",
          "errors": [
              {
                  "code": 3000,
                  "column": 56,
                  "line": 1,
                  "msg": "FILTER clause syntax is not valid for function array_max (near line 1, column 56). \n Error while parsing: runtime error: invalid memory address or nil pointer dereference"
              }
          ],
          "status": "fatal",

      stack:

      2023-11-21T14:15:11.691-08:00 [ERROR] Error while parsing: runtime error: invalid memory address or nil pointer dereference goroutine 1835 [running]:
      github.com/couchbase/query/parser/n1ql.doParse.func1()
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/parser/n1ql/n1ql.go:116 +0xa5
      panic({0x2ce5220?, 0x4e074d0?})
              /home/couchbase/.cbdepscache/exploded/x86_64/go-1.21.3/go/src/runtime/panic.go:914 +0x21f
      github.com/couchbase/query/parser/n1ql.(*yyParserImpl).Parse(0xc001ed1500, {0x3959048?, 0xc001c2ab00?})
              n1ql.y:1210 +0x419a
      github.com/couchbase/query/parser/n1ql.yyParse(...)
              yaccpar:153
      github.com/couchbase/query/parser/n1ql.doParse(0xc001c2ab00)
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/parser/n1ql/n1ql.go:124 +0x65
      github.com/couchbase/query/parser/n1ql.parseStatement({0xc00005cf00?, 0xc001c75a00?}, {0x3046260, 0x7}, {0x0, 0x0}, 0x1, {0x397d228, 0xc0021f3180})
              /home/couchbase/jenkins/workspace/couchbase-server-unix/goproj/src/github.com/couchbase/query/parser/n1ql/n1ql.go:57 +0x2ec
      github.com/couchbase/query/parser/n1ql.ParseStatement2({0xc00005cf00?, 0xc000100000?}, {0x3046260?, 0x0?}, {0x0?, 0x11b9da5?}, {0xc002601590?, 0x2de5600?, 0xc002601401?})
      ... 

      Attachments

        Activity

          People

            pierre.regazzoni Pierre Regazzoni
            pierre.regazzoni Pierre Regazzoni
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              PagerDuty