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

[CX] Explain plan button fails in the Analytics workbench when query has 'SET' statement

    XMLWordPrintable

Details

    • Untriaged
    • Unknown
    • CX Sprint 142, CX Sprint 143

    Description

      "Explain" button returns syntax error in the Analytics Workbench if a query text contains SET statement.
      To reproduce
      1. Go to analytics workbench
      2. Type the following query

      set `inline_with` `false`;
      LET x = random(), y = tostring
      FROM range(1,1) r
      SELECT x, y

      3. Press "Explain" button

      4. Error:
      [

      { "code": 24000, "msg": "Syntax error: In line 1 >>explain set `inline_with` `false`;<< Encountered \"set\" at column 9. ", "query_from_user": "set `inline_with` `false`;\nLET x = random(), y = tostring(x)\nFROM range(1,1) r\nSELECT x, y" }

      ]

      Workaround: manually add EXPLAIN after the SET statement:

      set `inline_with` `false`;
      EXPLAIN LET x = random(), y = tostring
      FROM range(1,1) r
      SELECT x, y

      "Explain" button works fine with this query.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              tanzeem.ahmed Tanzeem Ahmed (Inactive)
              dmitry.lychagin Dmitry Lychagin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty