Return-Path: X-Original-To: apmail-trafodion-commits-archive@www.apache.org Delivered-To: apmail-trafodion-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FD3E18782 for ; Fri, 21 Aug 2015 00:37:07 +0000 (UTC) Received: (qmail 93301 invoked by uid 500); 21 Aug 2015 00:37:07 -0000 Delivered-To: apmail-trafodion-commits-archive@trafodion.apache.org Received: (qmail 93271 invoked by uid 500); 21 Aug 2015 00:37:07 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 93260 invoked by uid 99); 21 Aug 2015 00:37:07 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 00:37:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 7AC77C08D9 for ; Fri, 21 Aug 2015 00:37:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.775 X-Spam-Level: * X-Spam-Status: No, score=1.775 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.006, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ViC3rUYOcKfx for ; Fri, 21 Aug 2015 00:36:58 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 1962542BE5 for ; Fri, 21 Aug 2015 00:36:58 +0000 (UTC) Received: (qmail 93073 invoked by uid 99); 21 Aug 2015 00:36:57 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Aug 2015 00:36:57 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 92206E7DF2; Fri, 21 Aug 2015 00:36:57 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dbirdsall@apache.org To: commits@trafodion.incubator.apache.org Date: Fri, 21 Aug 2015 00:36:58 -0000 Message-Id: <25a534992e25490391159efa1b581f06@git.apache.org> In-Reply-To: <55268f2646a146199283f0b8d57d225a@git.apache.org> References: <55268f2646a146199283f0b8d57d225a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] incubator-trafodion git commit: [TRAFODION-1460] - Allowing 'CURRENT' for qid [TRAFODION-1460] - Allowing 'CURRENT' for qid Within the same session, you can use explain option 'f' for qid current to display the explain plan of the recently compiled or executed statement. Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/daa0a478 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/daa0a478 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/daa0a478 Branch: refs/heads/master Commit: daa0a478b57672c9855bbb3f3fa6c62da0b7a507 Parents: 3b21457 Author: selvaganesang Authored: Wed Aug 19 22:10:03 2015 +0000 Committer: selvaganesang Committed: Wed Aug 19 22:10:03 2015 +0000 ---------------------------------------------------------------------- core/sql/executor/ExExplain.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/daa0a478/core/sql/executor/ExExplain.cpp ---------------------------------------------------------------------- diff --git a/core/sql/executor/ExExplain.cpp b/core/sql/executor/ExExplain.cpp index 8a271e6..28c64ce 100644 --- a/core/sql/executor/ExExplain.cpp +++ b/core/sql/executor/ExExplain.cpp @@ -1503,6 +1503,7 @@ RtsExplainFrag *ExExplainTcb::sendToSsmp() RtsExplainReq *explainReq; CliGlobals *cliGlobals = getGlobals()->castToExExeStmtGlobals()-> castToExMasterStmtGlobals()->getCliGlobals(); + ContextCli *context = cliGlobals->currContext(); if (cliGlobals->getStatsGlobals() == NULL) { // Runtime Stats not running. @@ -1512,6 +1513,14 @@ RtsExplainFrag *ExExplainTcb::sendToSsmp() return NULL; } + ExMasterStats *masterStats; + + if (strcasecmp(qid_, "CURRENT") == 0) { + if (context->getStats() != NULL && (masterStats = context->getStats()->getMasterStats()) != NULL) { + setQid(masterStats->getQueryId(), masterStats->getQueryIdLen()); + } + } + // Verify that we have valid parameters for each kind of request. If not, fill in the diagsArea // and return NULL. ExSsmpManager *ssmpManager = cliGlobals->getSsmpManager();