Skip to content

Commit 78b4ead

Browse files
committed
MB-67993
Merge remote-tracking branch 'couchbase/trinity' into HEAD Change-Id: I43bf826f1f933e8952c1ba73f5b1c5ae20c4ccab
2 parents 3ca50c9 + a947b6b commit 78b4ead

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
@@ -1654,11 +1654,12 @@ function getQwQueryService(
16541654

16551655
//
16561656
// run the explain version of the query, if appropriate
1657+
// we can't explain DDL statements, transactions, prepared statements, or explain or advise statements
16571658
//
16581659

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

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

0 commit comments

Comments
 (0)