Skip to content

Commit a947b6b

Browse files
committed
MB-67993
Merge remote-tracking branch 'couchbase/neo' into HEAD Change-Id: I9a6a4c7c8e966bd04612b71d44ae8bdc12e024ac
2 parents c6e1b98 + 90a9fe6 commit a947b6b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

query-ui/angular-services/qw.query.workbench.service.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,11 +1613,12 @@ function getQwQueryService(
16131613

16141614
//
16151615
// run the explain version of the query, if appropriate
1616+
// we can't explain DDL statements, transactions, prepared statements, or explain or advise statements
16161617
//
16171618

1618-
if (!queryIsExplain && !queryIsTransaction && !queryIsAdvise &&
1619-
(explainOnly || (qwConstantsService.autoExplain && !queryIsPrepare))) {
1619+
const queryIsExplainable = /^\s*(select|merge|update|delete|with)/gi.test(queryText);
16201620

1621+
if (queryIsExplainable && (explainOnly || qwConstantsService.autoExplain)) {
16211622
var explain_request = buildQueryRequest("explain " + queryText, false, qwQueryService.options, null, null, newResult);
16221623
if (!explain_request) {
16231624
newResult.result = '{"status": "query failed"}';

0 commit comments

Comments
 (0)