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

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\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.

Components

Affects versions

Fix versions

Environment

None

Link to Log File, atop/blg, CBCollectInfo, Core dump

None

Release Notes Description

None

Activity

Show:

CB robot March 18, 2019 at 1:23 PM

Build couchbase-server-6.5.0-2660 contains cbas-ui commit d8f601c with commit message:
: Allow Auto-Explain In Multi-Statements

CB robot March 14, 2019 at 9:55 PM

Build couchbase-server-6.0.2-2333 contains cbas-ui commit d8f601c with commit message:
: Allow Auto-Explain In Multi-Statements

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Tanzeem Ahmed

Reporter

Is this a Regression?

Unknown

Triage

Untriaged

Sprint

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created February 5, 2019 at 9:52 PM
Updated March 18, 2019 at 1:48 PM
Resolved March 14, 2019 at 9:57 PM
Instabug
Loading...