[TRAFODION-3220] Executor GUI

Adding the ability to display query execution with the "display"
command in Trafodion (sqlci only, requires an X Windows display,
just as the compiler GUI does).


Project: http://git-wip-us.apache.org/repos/asf/trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafodion/commit/4f3b0e8c
Tree: http://git-wip-us.apache.org/repos/asf/trafodion/tree/4f3b0e8c
Diff: http://git-wip-us.apache.org/repos/asf/trafodion/diff/4f3b0e8c

Branch: refs/heads/master
Commit: 4f3b0e8cbb45f743f4f79266473857473014f5dc
Parents: c52b07c
Author: Hans Zeller <[email protected]>
Authored: Tue Oct 9 01:06:18 2018 +0000
Committer: Hans Zeller <[email protected]>
Committed: Tue Oct 9 01:06:18 2018 +0000

----------------------------------------------------------------------
 core/sql/SqlCompilerDebugger/AboutBox.ui        |   2 +-
 .../SqlCompilerDebugger/BreakpointDialog.cpp    |   4 +-
 .../sql/SqlCompilerDebugger/BreakpointDialog.ui |   7 +
 core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h  |  46 +--
 .../sql/SqlCompilerDebugger/ExeQueueDisplay.cpp | 186 ++++++++++
 core/sql/SqlCompilerDebugger/ExeQueueDisplay.h  |  60 +++
 core/sql/SqlCompilerDebugger/ExeQueueDisplay.ui | 103 ++++++
 core/sql/SqlCompilerDebugger/ExeSchedWindow.cpp | 246 +++++++++++++
 core/sql/SqlCompilerDebugger/ExeSchedWindow.h   |  94 +++++
 core/sql/SqlCompilerDebugger/ExeSchedWindow.ui  | 165 +++++++++
 .../ExportFunctionSqlCmpDbg.cpp                 | 165 +++++----
 .../ExportFunctionSqlCmpDbg.h                   |  16 +-
 core/sql/SqlCompilerDebugger/MainWindow.cpp     |  29 +-
 core/sql/SqlCompilerDebugger/MainWindow.h       |   3 +-
 core/sql/SqlCompilerDebugger/QueryMemoView.cpp  |  41 ++-
 core/sql/SqlCompilerDebugger/QueryTreeView.cpp  |  11 +-
 core/sql/SqlCompilerDebugger/SqlCmpDbg.pro      |  19 +-
 core/sql/SqlCompilerDebugger/TCBTreeView.cpp    | 364 +++++++++++++++++++
 core/sql/SqlCompilerDebugger/TCBTreeView.h      |  98 +++++
 core/sql/SqlCompilerDebugger/TCBTreeView.ui     | 104 ++++++
 core/sql/SqlCompilerDebugger/TDBTreeView.cpp    |   5 +-
 core/sql/bin/SqlciErrors.txt                    |   1 +
 core/sql/cli/Cli.cpp                            |  38 +-
 core/sql/comexe/ComTdbRoot.h                    |   1 -
 core/sql/common/ComSqlcmpdbg.h                  |  19 +-
 core/sql/common/ComSqlexedbg.h                  |  54 ---
 core/sql/common/Ipc.cpp                         |   8 +
 core/sql/common/Ipc.h                           |   1 +
 core/sql/executor/ExScheduler.cpp               | 112 +++++-
 core/sql/executor/ExScheduler.h                 |  31 +-
 core/sql/executor/ex_esp_frag_dir.cpp           |   7 +-
 core/sql/executor/ex_esp_frag_dir.h             |   1 -
 core/sql/executor/ex_exe_stmt_globals.h         |   1 +
 core/sql/executor/ex_globals.cpp                |   5 +
 core/sql/executor/ex_globals.h                  |   2 +
 core/sql/executor/ex_root.cpp                   |  17 +-
 core/sql/executor/ex_root.h                     |   1 -
 core/sql/executor/ex_send_bottom.cpp            |   3 +-
 core/sql/executor/ex_send_top.cpp               |   4 +-
 core/sql/executor/ex_split_top.cpp              |   2 +-
 core/sql/nskgmake/executor/Makefile             |   4 +
 core/sql/optimizer/RelExpr.cpp                  |   3 +
 core/sql/optimizer/RelMisc.h                    |   6 +-
 core/sql/optimizer/opt.cpp                      |  47 +--
 core/sql/sqlcomp/CmpMain.cpp                    |  25 +-
 45 files changed, 1844 insertions(+), 317 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/AboutBox.ui
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/AboutBox.ui 
b/core/sql/SqlCompilerDebugger/AboutBox.ui
index 138f254..b498eb6 100644
--- a/core/sql/SqlCompilerDebugger/AboutBox.ui
+++ b/core/sql/SqlCompilerDebugger/AboutBox.ui
@@ -57,7 +57,7 @@
        <item>
         <widget class="QLabel" name="labelAboutCopyright">
          <property name="text">
-          <string>Copyright © 2013</string>
+          <string>Copyright © 2013-2018</string>
          </property>
          <property name="alignment">
           <set>Qt::AlignCenter</set>

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/BreakpointDialog.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/BreakpointDialog.cpp 
b/core/sql/SqlCompilerDebugger/BreakpointDialog.cpp
index bc3e56a..3435b48 100644
--- a/core/sql/SqlCompilerDebugger/BreakpointDialog.cpp
+++ b/core/sql/SqlCompilerDebugger/BreakpointDialog.cpp
@@ -55,7 +55,7 @@ void BreakpointDialog::ShowBreakpoint()
   ui_->chkDisplayAfterPrecodegen->setChecked(m_breakpoint->brkAfterPreCodegen);
   ui_->chkDisplayAfterCodegen->setChecked(m_breakpoint->brkAfterCodegen);
   ui_->chkDisplayAfterTdbGeneration->setChecked(m_breakpoint->brkAfterTDBgen);
-  //ui_->chkDisplayExecution->setChecked(m_breakpoint->brkDuringExecution);
+  ui_->chkDisplayExecution->setChecked(m_breakpoint->brkDuringExecution);
   // Set center screen
   QDesktopWidget * desktop = QApplication::desktop();
   move((desktop->width() - this->width()) / 2, (desktop->height() - 
this->height()) / 2);
@@ -78,6 +78,7 @@ void BreakpointDialog::on_bkptOK_clicked()
   m_breakpoint->brkAfterPreCodegen = 
ui_->chkDisplayAfterPrecodegen->isChecked();
   m_breakpoint->brkAfterCodegen = ui_->chkDisplayAfterCodegen->isChecked();
   m_breakpoint->brkAfterTDBgen = 
ui_->chkDisplayAfterTdbGeneration->isChecked();
+  m_breakpoint->brkDuringExecution = ui_->chkDisplayExecution->isChecked();
   done(0);
 }
 
@@ -109,4 +110,5 @@ void BreakpointDialog::setall(bool checked)
   ui_->chkDisplayAfterPrecodegen->setChecked(checked);
   ui_->chkDisplayAfterCodegen->setChecked(checked);
   ui_->chkDisplayAfterTdbGeneration->setChecked(checked);
+  ui_->chkDisplayExecution->setChecked(checked);
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/BreakpointDialog.ui
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/BreakpointDialog.ui 
b/core/sql/SqlCompilerDebugger/BreakpointDialog.ui
index 740ecba..9e0ea80 100644
--- a/core/sql/SqlCompilerDebugger/BreakpointDialog.ui
+++ b/core/sql/SqlCompilerDebugger/BreakpointDialog.ui
@@ -162,6 +162,13 @@
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="chkDisplayExecution">
+        <property name="text">
+         <string>Display execution</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h 
b/core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h
index 2d30701..acbafe8 100644
--- a/core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h
+++ b/core/sql/SqlCompilerDebugger/CommonSqlCmpDbg.h
@@ -27,7 +27,7 @@
  * File:         CommonSqlCmpDbg.h
  * Description:  This file contains declarations common to arkcmp components
  *               and tdm_sqlcmpdbg, the GUI tool used to display query
- *              compilation.
+ *              compilation and execution.
  *****************************************************************************
  */
 
@@ -51,6 +51,10 @@
 #include "ComTdb.h"
 #include "ex_tcb.h"
 
+// executor GUI header files
+#include "ex_exe_stmt_globals.h"
+#include "ExScheduler.h"
+
 #ifdef _c
 #undef _c
 #endif /*  */
@@ -78,43 +82,6 @@
 #define IDX_GENERIC 3
 
 #include "ComSqlcmpdbg.h"
-#if 0
-class Sqlcmpdbg
-{
-  // This class exists merely to give a nice naming scope for this enum
-public:
-  enum CompilationPhase
-  {
-    AFTER_PARSING,
-    AFTER_BINDING,
-    AFTER_TRANSFORMATION,
-    AFTER_NORMALIZATION,
-    AFTER_SEMANTIC_QUERY_OPTIMIZATION,
-    DURING_MVQR,
-    AFTER_ANALYZE,
-    AFTER_OPT1,
-    AFTER_OPT2,
-    AFTER_PRECODEGEN,
-    AFTER_CODEGEN,
-    AFTER_TDBGEN,
-    DURING_EXECUTION,
-    DURING_MEMOIZATION,
-    FROM_MSDEV
-  };
-};
-
-typedef struct tagSqlcmpdbgExpFuncs
-{
-  void (*fpDisplayQueryTree) (Sqlcmpdbg::CompilationPhase, void *, void *);
-  void (*fpSqldbgSetPointers) (void *, void *, void *, void *, void *);
-  void (*fpDoMemoStep) (Int32, Int32, Int32, void *, void *, void *);
-  void (*fpHideQueryTree) (BOOL);
-  void (*fpDisplayTDBTree) (Sqlcmpdbg::CompilationPhase, void *, void *);
-  NABoolean (*fpDisplayExecution) (void);
-  void (*fpCleanUp) (void);
-} SqlcmpdbgExpFuncs;
-typedef SqlcmpdbgExpFuncs *(*fpGetSqlcmpdbgExpFuncs) (void);
-#endif
 
 typedef struct tagSQLDebugBrkPts
 {
@@ -128,7 +95,8 @@ typedef struct tagSQLDebugBrkPts
     brkAfterOpt2 (FALSE),
     brkAfterPreCodegen (FALSE),
     brkAfterCodegen (FALSE),
-    brkAfterTDBgen (FALSE), brkDuringExecution (FALSE)
+    brkAfterTDBgen (FALSE),
+    brkDuringExecution (FALSE)
   {  }
   NABoolean brkAfterParsing;
   NABoolean brkAfterBinding;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeQueueDisplay.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeQueueDisplay.cpp 
b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.cpp
new file mode 100644
index 0000000..64f029d
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.cpp
@@ -0,0 +1,186 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#include "ExeQueueDisplay.h"
+#include "ui_ExeQueueDisplay.h"
+#include "CommonSqlCmpDbg.h"
+#include "TCBTreeView.h"
+
+ExeQueueDisplay::ExeQueueDisplay(const ex_tcb *tcb,
+                                 bool isUp,
+                                 QWidget *parent) :
+  QDialog(parent),
+  ui(new Ui::ExeQueueDisplay),
+  tcb_(tcb),
+  isUp_(isUp)
+{
+  ui->setupUi(this);
+
+  QString s = QString("%1 queue for %2 (Id: %3 Ex: %4)").
+                 arg(isUp_ ? "Up" : "Down").
+                 arg(tcb->getTdb()->getNodeName()).
+                 arg(tcb->getTdb()->getTdbId()).
+                 arg(tcb->getTdb()->getExplainNodeId());
+  setWindowTitle(s);
+  s = "";
+  setLabel(s);
+  populate();
+}
+
+ExeQueueDisplay::~ExeQueueDisplay()
+{
+  delete ui;
+}
+
+void ExeQueueDisplay::setLabel(QString &lbl)
+{
+    ui->queueLabel->setText(lbl);
+}
+
+void ExeQueueDisplay::populate()
+{
+  ex_queue_pair qp = tcb_->getParentQueue();
+  ex_queue *q = (isUp_ ? qp.up : qp.down);
+  queue_index qLength = q->getLength();
+  queue_index headIndex = q->getHeadIndex();
+  QStringList headers;
+
+  ui->tableWidget->setRowCount(qLength);
+  headers << "Index";
+  if (isUp_)
+    {
+      headers << "DownIx" << "ParentIx" << "State";
+      ui->tableWidget->setColumnCount(4);
+    }
+  else
+    {
+      headers << "ParentIx" << "State";
+      ui->tableWidget->setColumnCount(3);
+    }
+  ui->tableWidget->setHorizontalHeaderLabels(headers);
+  for (queue_index ix=0; ix<qLength; ix++)
+    {
+      ex_queue_entry *qEntry = q->getQueueEntry(headIndex+ix);
+
+      ui->tableWidget->setItem(ix, 0, new QTableWidgetItem(QString("%1").
+                           arg(headIndex + ix)));
+      if (isUp_)
+        {
+          up_state upState = qEntry->upState;
+          QString status;
+
+          ui->tableWidget->setItem(ix, 1, new QTableWidgetItem(QString("%1").
+                                                               
arg(upState.downIndex)));
+          ui->tableWidget->setItem(ix, 2, new QTableWidgetItem(QString("%1").
+                                                               
arg(upState.parentIndex)));
+
+          switch (upState.status)
+            {
+            case ex_queue::Q_NO_DATA:
+              status = "Q_NO_DATA";
+              break;
+            case ex_queue::Q_OK_MMORE:
+              status = "Q_OK_MMORE";
+              break;
+            case ex_queue::Q_SQLERROR:
+              status = "Q_SQLERROR";
+              break;
+            case ex_queue::Q_INVALID:
+              status = "Q_INVALID";
+              break;
+            case ex_queue::Q_GET_DONE:
+              status = "Q_GET_DONE";
+              break;
+            case ex_queue::Q_REC_SKIPPED:
+              status = "Q_REC_SKIPPED";
+              break;
+            case ex_queue::Q_STATS:
+              status = "Q_STATS";
+              break;
+            default:
+              status = QString("unknown: %1").arg((int) upState.status);
+              break;
+            }
+          ui->tableWidget->setItem(ix, 3, new QTableWidgetItem(status));
+        }
+      else
+        {
+          down_state downState = qEntry->downState;
+          QString status;
+
+          ui->tableWidget->setItem(ix, 1, new 
QTableWidgetItem(QString("%1").arg(downState.parentIndex)));
+
+          switch (downState.request)
+            {
+            case ex_queue::GET_N:
+              status = QString("GET_N (%1)").arg(downState.requestValue);
+              break;
+            case ex_queue::GET_ALL:
+              status = "GET_ALL";
+              break;
+            case ex_queue::GET_NOMORE:
+              status = "GET_NOMORE";
+              break;
+            case ex_queue::GET_EMPTY:
+              status = "GET_EMPTY";
+              break;
+            case ex_queue::GET_EOD:
+              status = "GET_EOD";
+              break;
+            case ex_queue::GET_EOD_NO_ST_COMMIT:
+              status = "GET_EOD_NO_ST_COMMIT";
+              break;
+            case ex_queue::GET_NEXT_N:
+              status = QString("GET_NEXT_N (%1)").arg(downState.requestValue);
+              break;
+            case ex_queue::GET_NEXT_N_MAYBE_WAIT:
+              status = "GET_NEXT_N_MAYBE_WAIT";
+              break;
+            case ex_queue::GET_NEXT_0_MAYBE_WAIT:
+              status = "GET_NEXT_0_MAYBE_WAIT";
+              break;
+            case ex_queue::GET_NEXT_N_SKIP:
+              status = "GET_NEXT_N_SKIP";
+              break;
+            case ex_queue::GET_NEXT_N_MAYBE_WAIT_SKIP:
+              status = "GET_NEXT_N_MAYBE_WAIT_SKIP";
+              break;
+            case ex_queue::GET_N_RETURN_SKIPPED:
+              status = "GET_N_RETURN_SKIPPED";
+              break;
+           default:
+              status = QString("unknown: %1").arg((int) downState.request);
+              break;
+            }
+          ui->tableWidget->setItem(ix, 2, new QTableWidgetItem(status));
+        }
+    }
+}
+
+void ExeQueueDisplay::on_okButton_clicked()
+{
+  delete this;
+}
+
+void ExeQueueDisplay::on_cancelButton_clicked()
+{
+  // same as OK button, just close the window
+  on_okButton_clicked();
+}

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeQueueDisplay.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeQueueDisplay.h 
b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.h
new file mode 100644
index 0000000..a73f8b3
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.h
@@ -0,0 +1,60 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#ifndef EXEQUEUEDISPLAY_H
+#define EXEQUEUEDISPLAY_H
+
+#include <QtGui>
+#include <QDialog>
+#include "CommonSqlCmpDbg.h"
+#include "ex_globals.h"
+#include "ex_tcb.h"
+
+namespace Ui {
+  class ExeQueueDisplay;
+  }
+
+class QTreeWidgetItem;
+
+class ExeQueueDisplay : public QDialog
+{
+  Q_OBJECT
+
+  public:
+  explicit ExeQueueDisplay(const ex_tcb *tcb,
+                           bool isUp,
+                           QWidget *parent);
+  ~ExeQueueDisplay();
+
+  void setLabel(QString & lbl);
+  void populate();
+
+  private slots:
+  void on_okButton_clicked();
+
+  void on_cancelButton_clicked();
+
+  private:
+  Ui::ExeQueueDisplay *ui;
+  const ex_tcb *tcb_;
+  bool isUp_;
+};
+
+#endif // EXEQUEUEDISPLAY_H

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeQueueDisplay.ui
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeQueueDisplay.ui 
b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.ui
new file mode 100644
index 0000000..fd21877
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeQueueDisplay.ui
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<ui version="4.0">
+ <class>ExeQueueDisplay</class>
+ <widget class="QDialog" name="ExeQueueDisplay">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>484</width>
+    <height>369</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <widget class="QWidget" name="verticalLayoutWidget">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>491</width>
+     <height>371</height>
+    </rect>
+   </property>
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="QLabel" name="queueLabel">
+      <property name="text">
+       <string>  Queue</string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <widget class="QTableWidget" name="tableWidget"/>
+    </item>
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <property name="leftMargin">
+       <number>9</number>
+      </property>
+      <property name="topMargin">
+       <number>9</number>
+      </property>
+      <property name="rightMargin">
+       <number>9</number>
+      </property>
+      <property name="bottomMargin">
+       <number>9</number>
+      </property>
+      <item>
+       <spacer name="horizontalSpacer">
+        <property name="orientation">
+         <enum>Qt::Horizontal</enum>
+        </property>
+        <property name="sizeHint" stdset="0">
+         <size>
+          <width>40</width>
+          <height>20</height>
+         </size>
+        </property>
+       </spacer>
+      </item>
+      <item>
+       <widget class="QPushButton" name="cancelButton">
+        <property name="text">
+         <string>Cancel</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="okButton">
+        <property name="text">
+         <string>OK</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeSchedWindow.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeSchedWindow.cpp 
b/core/sql/SqlCompilerDebugger/ExeSchedWindow.cpp
new file mode 100644
index 0000000..37e84cb
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeSchedWindow.cpp
@@ -0,0 +1,246 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#include "ExeSchedWindow.h"
+#include "ui_ExeSchedWindow.h"
+#include "CommonSqlCmpDbg.h"
+
+// defined in MainWindow.cpp
+extern QApplication* GlobGuiApplication;
+
+const int GlobGuiExeMaxFragInstances = 32;
+ExeSchedWindow *GlobGuiExeSchedWindow[GlobGuiExeMaxFragInstances];
+int GlobGuiExeFragInstancesLen = 0;
+
+ExeSchedWindow::ExeSchedWindow(QWidget *parent) :
+    QMainWindow(parent),
+    ui(new Ui::ExeSchedWindow)
+{
+    ui->setupUi(this);
+    headerIsInitialized_ = false;
+    isVisible_ = false;
+    keepProcessingEvents_ = true;
+    stopAtBreakpoints_ = true;
+    stopAtAllTasks_ = true;
+    hasSavedGeometry_ = false;
+    subtaskPtr_ = NULL;
+    tcbTreeView_ = new TCBTreeView(this);
+
+    // ViewContainer *viewContainer = new ViewContainer();
+    QMdiSubWindow *subWindow = ui->mdiArea->addSubWindow(tcbTreeView_);
+    subWindow->resize(ui->mdiArea->width() / 2, ui->mdiArea->height() / 2);
+    subWindow->showMaximized();
+
+}
+
+ExeSchedWindow::~ExeSchedWindow()
+{
+    delete ui;
+}
+
+void ExeSchedWindow::initializeStaticInfo(ExScheduler *sched)
+{
+  if (!headerIsInitialized_)
+    {
+      int frag, inst, numInst, nid, pid;
+      char buf[100];
+      char procName[100];
+      int xOffset = 0;
+      int yOffset = 0;
+      int xDelta = 75;
+      int yDelta = 75;
+      QDesktopWidget *desktop = QApplication::desktop();
+      int maxXOffset = (desktop->width() - this->width()) / 4;
+      int maxYOffset = (desktop->height() - this->height()) / 4;
+      sched->getProcInfoForGui(frag, inst, numInst, nid, pid, procName, 
sizeof(procName));
+
+      if (frag == 0)
+        snprintf(buf, sizeof(buf), "Master Executor");
+      else
+        snprintf(buf, sizeof(buf), "Fragment %d, instance %d of %d",
+                 frag, inst, numInst);
+      ui->centralwidget->parentWidget()->setWindowTitle(buf);
+
+      snprintf(buf, sizeof(buf), "%d, %d, %s", nid, pid, procName);
+      ui->nidPidLabel->setText(buf);
+      // position the windows such that they are staggered
+      // and their titles are visible, fragments at the same
+      // height and instances arranged left to right
+      xOffset = inst * xDelta;
+      yOffset = frag * yDelta;
+      if (xOffset > maxXOffset)
+        xOffset = maxXOffset;
+      if (yOffset > maxYOffset)
+        yOffset = maxYOffset;
+      move(xOffset, yOffset);
+
+      headerIsInitialized_ = true;
+    }
+}
+
+void ExeSchedWindow::run(ExSubtask **subtaskPtr)
+{
+    ensureVisible();
+    keepProcessingEvents_ = true;
+    subtaskPtr_ = subtaskPtr;
+
+    while (keepProcessingEvents_)
+    {
+        GlobGuiApplication->sendPostedEvents();
+        GlobGuiApplication->processEvents(
+             QEventLoop::WaitForMoreEvents |
+             QEventLoop::EventLoopExec);
+    }
+    subtaskPtr_ = NULL;
+    ensureInvisible();
+}
+
+void ExeSchedWindow::ensureVisible()
+{
+  if (!isVisible_)
+    {
+      if (hasSavedGeometry_)
+        setGeometry(savedGeometry_);
+      show();
+      isVisible_ = true;
+    }
+}
+
+void ExeSchedWindow::ensureInvisible()
+{
+  if (isVisible_)
+    {
+      savedGeometry_ = geometry();
+      hasSavedGeometry_ = true;
+      hide();
+      isVisible_ = false;
+    }
+}
+
+bool ExeSchedWindow::needToStop(void *subtask, void *scheduler)
+{
+    ExSubtask *st = static_cast<ExSubtask *>(subtask);
+    ExScheduler *sch = static_cast<ExScheduler *>(scheduler);
+
+    if (scheduler != NULL &&
+        (stopAtAllTasks_ ||
+         (st && st->getBreakPoint() && stopAtBreakpoints_)))
+      {
+        initializeStaticInfo(sch);
+
+        if (tcbTreeView_ && st && st->getTcb())
+          tcbTreeView_->displayTcbTree(st->getTcb(), st, sch);
+        return true;
+      }
+
+    return false;
+}
+
+void ExeSchedWindow::on_finishButton_clicked()
+{
+    keepProcessingEvents_ = false;
+    stopAtBreakpoints_ = false;
+    stopAtAllTasks_ = false;
+}
+
+void ExeSchedWindow::on_nextBptButton_clicked()
+{
+    keepProcessingEvents_ = false;
+    stopAtBreakpoints_ = true;
+    stopAtAllTasks_ = false;
+}
+
+void ExeSchedWindow::on_nextTaskButton_clicked()
+{
+    keepProcessingEvents_ = false;
+    stopAtBreakpoints_ = true;
+    stopAtAllTasks_ = true;
+}
+bool ExeSchedWindow::stopAtAllTasks() const
+{
+    return stopAtAllTasks_;
+}
+
+void ExeSchedWindow::setStopAtAllTasks(bool stopAtAllTasks)
+{
+    stopAtAllTasks_ = stopAtAllTasks;
+  }
+
+ExeSchedWindow *ExeSchedWindow::findInstance(ExScheduler *sched)
+{
+    int fragInstId = sched->getFragInstIdForGui();
+
+    if (fragInstId >= GlobGuiExeFragInstancesLen)
+      {
+        if (fragInstId >= GlobGuiExeMaxFragInstances)
+          // this is not handled right now
+          return NULL;
+
+        // fill the array that is now used with NULLs
+        for (int i=GlobGuiExeFragInstancesLen; i<=fragInstId; i++)
+          GlobGuiExeSchedWindow[i] = NULL;
+        GlobGuiExeFragInstancesLen = fragInstId+1;
+      }
+    if (GlobGuiExeSchedWindow[fragInstId] == NULL)
+      GlobGuiExeSchedWindow[fragInstId] = new ExeSchedWindow();
+
+    return GlobGuiExeSchedWindow[fragInstId];
+  }
+
+void ExeSchedWindow::deleteInstance(void *scheduler)
+{
+  ExScheduler *sched = static_cast<ExScheduler *>(scheduler);
+  int fragInstId = sched->getFragInstIdForGui();
+
+  if (fragInstId >= 0 && fragInstId < GlobGuiExeFragInstancesLen)
+    {
+      delete GlobGuiExeSchedWindow[fragInstId];
+      GlobGuiExeSchedWindow[fragInstId] = NULL;
+    }
+  }
+
+void ExeSchedWindow::deleteAllInstances()
+{
+  for (int i=0; i<GlobGuiExeFragInstancesLen; i++)
+    if (GlobGuiExeSchedWindow[i])
+      delete GlobGuiExeSchedWindow[i];
+  GlobGuiExeFragInstancesLen = 0;
+}
+
+bool ExeSchedWindow::stopAtBreakpoints() const
+{
+    return stopAtBreakpoints_;
+}
+
+void ExeSchedWindow::setStopAtBreakpoints(bool stopAtBreakpoints)
+{
+    stopAtBreakpoints_ = stopAtBreakpoints;
+}
+
+bool ExeSchedWindow::keepProcessingEvents() const
+{
+    return keepProcessingEvents_;
+}
+
+void ExeSchedWindow::setKeepProcessingEvents(bool keepProcessingEvents)
+{
+    keepProcessingEvents_ = keepProcessingEvents;
+}
+

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeSchedWindow.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeSchedWindow.h 
b/core/sql/SqlCompilerDebugger/ExeSchedWindow.h
new file mode 100644
index 0000000..038a62d
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeSchedWindow.h
@@ -0,0 +1,94 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#ifndef EXESCHEDWINDOW_H
+#define EXESCHEDWINDOW_H
+
+#include <QMainWindow>
+#include "TCBTreeView.h"
+
+namespace Ui {
+class ExeSchedWindow;
+}
+
+class ExSubtask;
+class ExScheduler;
+
+class ExeSchedWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    explicit ExeSchedWindow(QWidget *parent = 0);
+    ~ExeSchedWindow();
+
+    // initialize the info at the top of the window
+    void initializeStaticInfo(ExScheduler *sched);
+
+    // drive the event loop for the window until we
+    // are ready to resume with the executor tasks
+    void run(ExSubtask **subtaskPtr);
+    // ensure the window is visible/invisible
+    void ensureVisible();
+    void ensureInvisible();
+    // check whether the user requested to see the
+    // GUI for this particular subtask
+    bool needToStop(void *subtask, void *scheduler);
+
+    // should the run() method continue to process events?
+    bool keepProcessingEvents() const;
+    void setKeepProcessingEvents(bool keepProcessingEvents);
+
+    bool stopAtBreakpoints() const;
+    void setStopAtBreakpoints(bool stopAtBreakpoints);
+
+    bool stopAtAllTasks() const;
+    void setStopAtAllTasks(bool stopAtAllTasks);
+
+    // find the instance id of a TCB tree, given the
+    // scheduler
+    static ExeSchedWindow *findInstance(ExScheduler *sched);
+    static void deleteInstance(void *scheduler);
+    static void deleteAllInstances();
+
+    // get the main window
+    ExSubtask **getSubtaskPtr() { return subtaskPtr_; }
+
+private slots:
+    void on_finishButton_clicked();
+
+    void on_nextBptButton_clicked();
+
+    void on_nextTaskButton_clicked();
+
+private:
+    Ui::ExeSchedWindow *ui;
+    bool headerIsInitialized_;
+    bool isVisible_;
+    bool keepProcessingEvents_;
+    bool stopAtBreakpoints_;
+    bool stopAtAllTasks_;
+    QRect savedGeometry_;
+    bool hasSavedGeometry_;
+    ExSubtask **subtaskPtr_;
+    TCBTreeView *tcbTreeView_;
+};
+
+#endif // EXESCHEDWINDOW_H

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExeSchedWindow.ui
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExeSchedWindow.ui 
b/core/sql/SqlCompilerDebugger/ExeSchedWindow.ui
new file mode 100644
index 0000000..7492b72
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/ExeSchedWindow.ui
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<ui version="4.0">
+ <class>ExeSchedWindow</class>
+ <widget class="QMainWindow" name="ExeSchedWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>627</width>
+    <height>547</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <property name="windowIcon">
+   <iconset>
+    
<normaloff>Resource/Main/SQ_Logo.png</normaloff>Resource/Main/SQ_Logo.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,16,2">
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="fNidPid">
+          <property name="text">
+           <string>Nid, pid, proc:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QLabel" name="nidPidLabel">
+          <property name="text">
+           <string>nnnn, pppppp, $XXXXXX</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+       </layout>
+      </item>
+      <item>
+       <widget class="QMdiArea" name="mdiArea"/>
+      </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_3">
+        <item>
+         <spacer name="horizontalSpacer">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
+        <item>
+         <widget class="QPushButton" name="nextTaskButton">
+          <property name="toolTip">
+           <string>Process the current task</string>
+          </property>
+          <property name="text">
+           <string>Next Task</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="nextBptButton">
+          <property name="toolTip">
+           <string>Run to the next breakpoint, if any</string>
+          </property>
+          <property name="text">
+           <string>Next Breakpoint</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QPushButton" name="finishButton">
+          <property name="toolTip">
+           <string>Close this window and finish processisng without 
stopping</string>
+          </property>
+          <property name="text">
+           <string>Finish</string>
+          </property>
+         </widget>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>627</width>
+     <height>26</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFragment_x_instance_y_of_z">
+    <property name="title">
+     <string>File</string>
+    </property>
+   </widget>
+   <widget class="QMenu" name="menuTools">
+    <property name="title">
+     <string>Tools</string>
+    </property>
+   </widget>
+   <addaction name="menuFragment_x_instance_y_of_z"/>
+   <addaction name="menuTools"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <widget class="QToolBar" name="toolBar">
+   <property name="windowTitle">
+    <string>toolBar</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.cpp 
b/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.cpp
index d78868c..61afbe0 100644
--- a/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.cpp
+++ b/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.cpp
@@ -21,71 +21,75 @@
 #include <QtGui>
 #include "ExportFunctionSqlCmpDbg.h"
 #include "MainWindow.h"
-#include "QueryData.h" 
+#include "QueryData.h"
+#include "ExeSchedWindow.h"
 
 #define DISPLAY_WARNING 1032
- 
-extern MainWindow *mainWindow_;
-extern SqlcmpdbgExpFuncs exportFunctions_;
-extern QApplication* application_;
+
+// defined in MainWindow.cpp
+extern MainWindow *GlobGuiMainWindow;
+extern SqlcmpdbgExpFuncs GlobGuiExportFunctions;
+extern QApplication* GlobGuiApplication;
+
 static int argc = 1;
 static char **argv;    
 
-SqlcmpdbgExpFuncs * GetSqlcmpdbgExpFuncs(void) 
+SqlcmpdbgExpFuncs * GetSqlcmpdbgExpFuncs()
 {
-  if (application_ == NULL)
-     application_ = new QApplication(argc, argv);
-     
-  if(mainWindow_)
-    delete mainWindow_;
-  mainWindow_ = new MainWindow();
-  exportFunctions_.fpDisplayQueryTree = DisplayQueryTree;
-  exportFunctions_.fpSqldbgSetPointers = SqldbgSetPointers;
-  exportFunctions_.fpDoMemoStep = DoMemoStep;
-  exportFunctions_.fpHideQueryTree = HideQueryTree;
-  exportFunctions_.fpDisplayTDBTree = DisplayTDBTree;
-  exportFunctions_.fpDisplayExecution = DisplayExecution;
-  exportFunctions_.fpCleanUp = CleanUp;
-  return &exportFunctions_;
+  if (GlobGuiApplication == NULL)
+     GlobGuiApplication = new QApplication(argc, argv);
+
+  GlobGuiExportFunctions.fpDisplayQueryTree = DisplayQueryTree;
+  GlobGuiExportFunctions.fpSqldbgSetCmpPointers = SqldbgSetCmpPointers;
+  GlobGuiExportFunctions.fpDoMemoStep = DoMemoStep;
+  GlobGuiExportFunctions.fpHideQueryTree = HideQueryTree;
+  GlobGuiExportFunctions.fpDisplayTDBTree = DisplayTDBTree;
+  GlobGuiExportFunctions.fpExecutionDisplayIsEnabled = 
ExecutionDisplayIsEnabled;
+  GlobGuiExportFunctions.fpSqldbgSetExePointers = SqldbgSetExePointers;
+  GlobGuiExportFunctions.fpDisplayExecution = DisplayExecution;
+  GlobGuiExportFunctions.fpCleanUp = CleanUp;
+  return &GlobGuiExportFunctions;
 }
 
 void DisplayQueryTree(Sqlcmpdbg::CompilationPhase phase, 
                         void *tree, void *plan) 
 {
-  if (MainWindow::IsQuiting)
+  if (MainWindow::IsQuitting)
     return;
-  mainWindow_->SetDocumentTitle(phase);
-  mainWindow_->show();
-  if (!mainWindow_->NeedToDisplay(phase)) 
+
+  GlobGuiMainWindow->SetDocumentTitle(phase);
+  GlobGuiMainWindow->show();
+  if (!GlobGuiMainWindow->NeedToDisplay(phase)) 
   {
-      mainWindow_->hide();
+      GlobGuiMainWindow->hide();
       return;
   }
-  mainWindow_->m_querydata->SetPhase(phase);
-  mainWindow_->m_querydata->SetData(tree, plan);
-  mainWindow_->syncMemoWithDoc();
+  GlobGuiMainWindow->m_querydata->SetPhase(phase);
+  GlobGuiMainWindow->m_querydata->SetData(tree, plan);
+  GlobGuiMainWindow->syncMemoWithDoc();
   
-  mainWindow_->UpdateAllViews();
-  mainWindow_->Run();
-  mainWindow_->hide();
+  GlobGuiMainWindow->UpdateAllViews();
+  GlobGuiMainWindow->Run();
+  GlobGuiMainWindow->hide();
 }
 
-void SqldbgSetPointers(void *memoptr , void *tasklist ,
-                         void *analysis , void *currentContext ,
-                         void *ClusterInfo ) 
+void SqldbgSetCmpPointers(void *memoptr , void *tasklist ,
+                          void *analysis , void *currentContext ,
+                          void *ClusterInfo ) 
 {
-  if (MainWindow::IsQuiting)
+  if (MainWindow::IsQuitting)
     return;
-  mainWindow_->m_querydata->SetMemo(memoptr);
-  mainWindow_->m_querydata->SetAnalysis(analysis);
-  mainWindow_->m_querydata->SetTaskList(tasklist);
+
+  ExeSchedWindow::deleteAllInstances();
+
+  if (GlobGuiMainWindow == NULL)
+    GlobGuiMainWindow = new MainWindow();
+
+  GlobGuiMainWindow->m_querydata->SetMemo(memoptr);
+  GlobGuiMainWindow->m_querydata->SetAnalysis(analysis);
+  GlobGuiMainWindow->m_querydata->SetTaskList(tasklist);
   cmpCurrentContext = (CmpContext *) currentContext;
 
-  CURRSTMT_OPTGLOBALS->memo = (CascadesMemo *) memoptr;
-  
-  // Initialize the GUI pointer to the compiler's global cluster info:
-  gpClusterInfo = (NAClusterInfo *) ClusterInfo;
-  
   // --------------------------------------------------------------
   // initialize optimization defaults
   // This is needed to initialize re-calibration constants
@@ -96,29 +100,29 @@ void SqldbgSetPointers(void *memoptr , void *tasklist ,
 void DoMemoStep(Int32 passNo, Int32 groupNo, Int32 taskNo, void *task,
                   void *expr, void *plan) 
 {
-  if (MainWindow::IsQuiting)
+  if (MainWindow::IsQuitting)
     return;
-  if (mainWindow_->NeedToStop(passNo,groupNo,taskNo,(CascadesTask *)task, 
(ExprNode *)expr,(CascadesPlan *)plan))
+  if (GlobGuiMainWindow->NeedToStop(passNo,groupNo,taskNo,(CascadesTask 
*)task, (ExprNode *)expr,(CascadesPlan *)plan))
   {
-     mainWindow_->show();
-     mainWindow_->Run();
+     GlobGuiMainWindow->show();
+     GlobGuiMainWindow->Run();
   }
 }
 
 void HideQueryTree(BOOL flag) 
 {
-  if (MainWindow::IsQuiting)
+  if (MainWindow::IsQuitting)
     return;
-  mainWindow_->setVisible(flag);
+  GlobGuiMainWindow->setVisible(flag);
 }
 
 void DisplayTDBTree(Sqlcmpdbg::CompilationPhase phase, 
                       void *tdb, void *fragDir) 
 {
-  if (MainWindow::IsQuiting)
+  if (MainWindow::IsQuitting)
     return;
 
-  if (!mainWindow_->NeedToDisplay(phase)) 
+  if (!GlobGuiMainWindow->NeedToDisplay(phase)) 
     return;
   
//-----------------------------------------------------------------------------
   // GSH : The document class of the SQL/debug MDI DLL holds all the data that 
@@ -129,25 +133,58 @@ void DisplayTDBTree(Sqlcmpdbg::CompilationPhase phase,
   // member function setDocumentData(ExprNode* tree = NULL, CascadesPlan* 
plan=NULL) 
   // function to set the private data members of the document object.
   
//-----------------------------------------------------------------------------
-  mainWindow_->CreateTDBView();
-  mainWindow_->m_querydata->SetTDBData(tdb, fragDir);
-  mainWindow_->m_querydata->SetPhase(phase);
-  mainWindow_->show();
-  mainWindow_->UpdateAllViews();
-  mainWindow_->Run();
-  mainWindow_->hide();
+  GlobGuiMainWindow->CreateTDBView();
+  GlobGuiMainWindow->m_querydata->SetTDBData(tdb, fragDir);
+  GlobGuiMainWindow->m_querydata->SetPhase(phase);
+  GlobGuiMainWindow->show();
+  GlobGuiMainWindow->UpdateAllViews();
+  GlobGuiMainWindow->Run();
+  GlobGuiMainWindow->hide();
 }
 
-NABoolean DisplayExecution(void)
+int  ExecutionDisplayIsEnabled(void)
 {
-  *CmpCommon::diags() << DgSqlCode(DISPLAY_WARNING);
-  return FALSE;
+  return GlobGuiMainWindow->MainWindow::NeedToDisplay(
+       Sqlcmpdbg::DURING_EXECUTION);
+}
+
+void SqldbgSetExePointers(void *rootTcb,
+                          void *cliGlobals,
+                          void *dummy)
+{
+  // TODO: determine if this is needed, scheduler has all ptrs
+}
+
+void DisplayExecution(ExSubtask **subtask, ExScheduler *scheduler)
+{
+  ExeSchedWindow *myWindow = ExeSchedWindow::findInstance(scheduler);
+
+  if (GlobGuiMainWindow)
+    {
+      delete GlobGuiMainWindow;
+      GlobGuiMainWindow = NULL;
+    }
+
+  if (subtask == NULL)
+    {
+      // passing a NULL subtask is a sign that
+      // we are done, delete the window
+      if (scheduler)
+        ExeSchedWindow::deleteInstance(scheduler);
+      return;
+    }
+
+  if (!myWindow->needToStop(*subtask, scheduler))
+    // no need to stop at this task
+    return;
+
+  myWindow->run(subtask);
 }
 
 void CleanUp(void)
 {
-  if(mainWindow_)
-    delete mainWindow_;
-  mainWindow_ = NULL;
+  if(GlobGuiMainWindow)
+    delete GlobGuiMainWindow;
+  GlobGuiMainWindow = NULL;
 }
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.h 
b/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.h
index 28a1186..3328f44 100644
--- a/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.h
+++ b/core/sql/SqlCompilerDebugger/ExportFunctionSqlCmpDbg.h
@@ -25,14 +25,14 @@
 using namespace std;
 
 #include "CommonSqlCmpDbg.h"
-extern "C" Q_DECL_EXPORT SqlcmpdbgExpFuncs * GetSqlcmpdbgExpFuncs (void);
+extern "C" Q_DECL_EXPORT SqlcmpdbgExpFuncs * GetSqlcmpdbgExpFuncs ();
 extern "C" Q_DECL_EXPORT void DisplayQueryTree (Sqlcmpdbg::CompilationPhase
                                                phase, void *tree =
                                                NULL, void *plan = NULL);
-extern "C" Q_DECL_EXPORT void SqldbgSetPointers (void *memo, void *tasklist,
-                                                void *analysis,
-                                                void *currentContext,
-                                                void *ClusterInfo);
+extern "C" Q_DECL_EXPORT void SqldbgSetCmpPointers (void *memo, void *tasklist,
+                                                    void *analysis,
+                                                    void *currentContext,
+                                                    void *ClusterInfo);
 extern "C" Q_DECL_EXPORT void DoMemoStep (Int32 passNo = -1, Int32 groupNo =
                                          -1, Int32 taskNo = -1, void *task =
                                          NULL, void *expr =
@@ -41,7 +41,11 @@ extern "C" Q_DECL_EXPORT void HideQueryTree (BOOL flag = 
TRUE);
 extern "C" Q_DECL_EXPORT void DisplayTDBTree (Sqlcmpdbg::CompilationPhase
                                              phase, void *tdb,
                                              void *fragDir);
-extern "C" Q_DECL_EXPORT NABoolean DisplayExecution (void);
+extern "C" Q_DECL_EXPORT int  ExecutionDisplayIsEnabled (void);
+extern "C" Q_DECL_EXPORT void SqldbgSetExePointers (void *rootTcb,
+                                                    void *cliGlobals,
+                                                    void *dummy);
+extern "C" Q_DECL_EXPORT void DisplayExecution (ExSubtask**, ExScheduler *);
 
 extern "C" Q_DECL_EXPORT void CleanUp(void);
 #endif // EXPORTFUNCTIONSQLCMPDBG_H

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/MainWindow.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/MainWindow.cpp 
b/core/sql/SqlCompilerDebugger/MainWindow.cpp
index 17d75df..ee8d87d 100644
--- a/core/sql/SqlCompilerDebugger/MainWindow.cpp
+++ b/core/sql/SqlCompilerDebugger/MainWindow.cpp
@@ -35,20 +35,20 @@
   The QApplication should be constructed before any UI control variables, e.g. 
the MainWindow.
   Otherwise, the UI cannot be launch due to errors.
 */
-QApplication* application_ = NULL;
+QApplication* GlobGuiApplication = NULL;
 
 /*
   The MainWindow must be constucted after the QApplication.
   Otherwise, the UI cannot be launch due to errors.
 
-  For every display query sesion,
-  MainWindow one object will be created when GetSqlcmpdbgExpFuncs is called,
-  and delete at end of DisplayTDBTree
+  For every display query session, the MainWindow global
+  object will be created when SqldbgSetCmpPointers is called
+  for the first time.
 */
 
-MainWindow *mainWindow_ = NULL;
-SqlcmpdbgExpFuncs exportFunctions_;
-NABoolean MainWindow::IsQuiting = false;
+MainWindow *GlobGuiMainWindow = NULL;
+SqlcmpdbgExpFuncs GlobGuiExportFunctions;
+NABoolean MainWindow::IsQuitting = false;
 
 
 MainWindow::MainWindow(QWidget * parent):QMainWindow(parent), ui(new 
Ui::MainWindow),
@@ -57,7 +57,7 @@ m_popMenu(NULL)
     ui->setupUi(this);
     //Initialize
     m_FinishAllOptimizePass = FALSE;
-    IsQuiting = FALSE;
+    IsQuitting = FALSE;
     // Set center screen
     QDesktopWidget *desktop = QApplication::desktop();
     move((desktop->width() - this->width()) / 2,
@@ -86,13 +86,14 @@ m_popMenu(NULL)
 NABoolean MainWindow::Run()
 {
     IsBackToSqlCompiler_ = FALSE;
-    IsQuiting = FALSE;
+    IsQuitting = FALSE;
     while (!IsBackToSqlCompiler_)
     {
-        if (!IsQuiting)
+        if (!IsQuitting)
         {
-            application_->processEvents(QEventLoop::WaitForMoreEvents |
-                                       QEventLoop::EventLoopExec);
+            GlobGuiApplication->processEvents(
+                 QEventLoop::WaitForMoreEvents |
+                 QEventLoop::EventLoopExec);
         }
         else
         {
@@ -185,7 +186,7 @@ NABoolean 
MainWindow::NeedToDisplay(Sqlcmpdbg::CompilationPhase phase)
         retval = m_breakpoint->brkAfterTDBgen;
         break;
     case Sqlcmpdbg::DURING_EXECUTION:
-        retval = FALSE;
+        retval = m_breakpoint->brkDuringExecution;
         break;
     case Sqlcmpdbg::DURING_MEMOIZATION:
         retval = TRUE;
@@ -718,7 +719,7 @@ void MainWindow::closeEvent(QCloseEvent * event)
     }
     else
     {
-      IsQuiting = TRUE;
+      IsQuitting = TRUE;
       event->accept();
     }
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/MainWindow.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/MainWindow.h 
b/core/sql/SqlCompilerDebugger/MainWindow.h
index 8386162..9e80f1a 100644
--- a/core/sql/SqlCompilerDebugger/MainWindow.h
+++ b/core/sql/SqlCompilerDebugger/MainWindow.h
@@ -54,9 +54,10 @@ public:
   void CreateTDBView();
   void RestoreGeometry();
   void SaveGeometry();
+  NABoolean IsDisplayExecutionEnabled();
 
   NABoolean IsBackToSqlCompiler_;
-  static NABoolean IsQuiting;
+  static NABoolean IsQuitting;
   QueryData *m_querydata;
 
 protected:

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/QueryMemoView.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/QueryMemoView.cpp 
b/core/sql/SqlCompilerDebugger/QueryMemoView.cpp
index b007e8c..144a0aa 100644
--- a/core/sql/SqlCompilerDebugger/QueryMemoView.cpp
+++ b/core/sql/SqlCompilerDebugger/QueryMemoView.cpp
@@ -23,7 +23,8 @@
 #include "QueryData.h"
 #include "MainWindow.h"
 
-extern MainWindow *mainWindow_;
+// defined in MainWindow.cpp
+extern MainWindow *GlobGuiMainWindow;
 
 
 DirtyGrid::DirtyGrid(Int32 row, Int32 col,const QIcon & pict) :
@@ -164,10 +165,10 @@ void QueryMemoView::SetMemoData(void *memoData)
 void QueryMemoView::syncToDocument() 
 {
   // make Grp No and Exp No consistent with the plan in the document.
-  m_memo =  (CascadesMemo*)(mainWindow_->m_querydata->GetMemo());
+  m_memo =  (CascadesMemo*)(GlobGuiMainWindow->m_querydata->GetMemo());
   void *plan = NULL;
   void *query = NULL;
-  mainWindow_->m_querydata->GetData(&query, &plan);
+  GlobGuiMainWindow->m_querydata->GetData(&query, &plan);
   if(plan)
     syncGrpNoExpNoToPlan((CascadesPlan *)plan);
 }
@@ -220,13 +221,13 @@ NABoolean QueryMemoView::NeedToStop(Int32 passNo, Int32 
groupNo, Int32 currentTa
   {
        logprint("m_stopTask:%p => task:%p\n", m_stopTask, task);
        m_hold = TRUE;
-       m_memo =  (CascadesMemo*)(mainWindow_->m_querydata->GetMemo());
-       m_cascadesTask = 
(CascadesTaskList*)(mainWindow_->m_querydata->GetTaskList());
+       m_memo =  (CascadesMemo*)(GlobGuiMainWindow->m_querydata->GetMemo());
+       m_cascadesTask = 
(CascadesTaskList*)(GlobGuiMainWindow->m_querydata->GetTaskList());
        //------------------------------------------------------------------
        // GSH : First we need to update the memo view with the latest memo
        // and task list.
        //------------------------------------------------------------------
-       m_analysis = (QueryAnalysis*)(mainWindow_->m_querydata->GetAnalysis());
+       m_analysis = 
(QueryAnalysis*)(GlobGuiMainWindow->m_querydata->GetAnalysis());
 
        UpdateGroupList();
 
@@ -474,7 +475,7 @@ void QueryMemoView::UpdateTaskList()
   // display the text describing each task in the m_task List control of
   // the Memo View.
   //---------------------------------------------------------------------
-  m_cascadesTask = 
(CascadesTaskList*)(mainWindow_->m_querydata->GetTaskList());
+  m_cascadesTask = 
(CascadesTaskList*)(GlobGuiMainWindow->m_querydata->GetTaskList());
   //---------------------------------------------------------------------
   // GSH : Don't do anything if we aren't optimizing
   //---------------------------------------------------------------------
@@ -605,14 +606,14 @@ CascadesPlan * QueryMemoView::calcCurrPlan()
 void QueryMemoView::setDisplayExpr(RelExpr* expr, CascadesPlan* plan)
 {
   // need to update m_currGrpNo & m_currExpNo
-  mainWindow_->m_querydata->SetData(expr, plan);
-  //mainWindow_->UpdateAllViews();
-  mainWindow_->UpdateQueryTreeView();
+  GlobGuiMainWindow->m_querydata->SetData(expr, plan);
+  //GlobGuiMainWindow->UpdateAllViews();
+  GlobGuiMainWindow->UpdateQueryTreeView();
 }
 
 void QueryMemoView::DrawMemo(void)
 {      
-  m_memo = (CascadesMemo*)(mainWindow_->m_querydata->GetMemo());
+  m_memo = (CascadesMemo*)(GlobGuiMainWindow->m_querydata->GetMemo());
   if(!m_memo){
     m_currGrpNo = 0;
     m_currExpNo = 0;
@@ -918,7 +919,7 @@ void QueryMemoView::OnMemoStepOneTask()
 {
   ResetMemoStops();
   StopAtNextTask(TRUE);
-  mainWindow_->IsBackToSqlCompiler_ = true;
+  GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
   turnOffMemoTrack();
 }
 
@@ -932,7 +933,7 @@ void QueryMemoView::OnMemoSteptasknum()
     }
     ResetMemoStops();
     StopAtTaskNo(ui->task_spin->value(), TRUE);                
-    mainWindow_->IsBackToSqlCompiler_ = true;
+    GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
 }
 
 void QueryMemoView::OnMemoStepTask()
@@ -946,7 +947,7 @@ void QueryMemoView::OnMemoStepTask()
          return;
        ResetMemoStops();
        StopAtTask(task, TRUE);
-       mainWindow_->IsBackToSqlCompiler_ = true;
+       GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
     }
 }
 
@@ -954,27 +955,27 @@ void QueryMemoView::OnMemoStepgrp()
 {
   ResetMemoStops();
   StopAtExpr(ui->group_spin->value(), -1, TRUE);       
-  mainWindow_->IsBackToSqlCompiler_ = true;
+  GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
 }
 
 void QueryMemoView::OnMemoStepexpr() 
 {
   ResetMemoStops();
   StopAtExpr(ui->group_spin->value(), ui->expr_spin->value(), TRUE);           
-  mainWindow_->IsBackToSqlCompiler_ = true;
+  GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
 }
 
 void QueryMemoView::OnMemoFinish() 
 {
   ResetMemoStops();
-  mainWindow_->IsBackToSqlCompiler_ = true;
+  GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
   turnOffMemoTrack();
 }
 
 void QueryMemoView::OnMemoFinishpass() 
 {
   ResetMemoStops();
-  mainWindow_->IsBackToSqlCompiler_ = true;
+  GlobGuiMainWindow->IsBackToSqlCompiler_ = true;
   turnOffMemoTrack();
 }
 
@@ -1064,7 +1065,7 @@ void QueryMemoView::displayCurrExpr()
        }
     }
     //set tree root of query viewer
-    mainWindow_->m_querydata->SetData(e, p);
-    mainWindow_->UpdateQueryTreeView();
+    GlobGuiMainWindow->m_querydata->SetData(e, p);
+    GlobGuiMainWindow->UpdateQueryTreeView();
   }
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/QueryTreeView.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/QueryTreeView.cpp 
b/core/sql/SqlCompilerDebugger/QueryTreeView.cpp
index fc9c1f1..da6caa2 100644
--- a/core/sql/SqlCompilerDebugger/QueryTreeView.cpp
+++ b/core/sql/SqlCompilerDebugger/QueryTreeView.cpp
@@ -23,7 +23,8 @@
 #include "MainWindow.h"
 #include "QueryData.h"
 
-extern MainWindow *mainWindow_;
+// defined in MainWindow.cpp
+extern MainWindow *GlobGuiMainWindow;
 
 QueryTreeView::QueryTreeView(QWidget * parent):
 QWidget(parent), ui(new Ui::QueryTreeView)
@@ -63,7 +64,7 @@ void QueryTreeView::UpdateView()
     //------------------------------------------------------------------
     void *tree;
     void *plan;
-    mainWindow_->m_querydata->GetData(&tree, &plan);
+    GlobGuiMainWindow->m_querydata->GetData(&tree, &plan);
     DisplayQueryTree(tree, plan, NULL);
     ui->m_tree->expandAll();
     for (int i = 0; i < ui->m_tree->columnCount(); i++)
@@ -410,8 +411,8 @@ on_m_tree_customContextMenuRequested(const QPoint & pos)
     DFTDETAILS *pDft = v.value < DFTDETAILS * >();
     if (NULL != pDft)
     {
-        mainWindow_->m_querydata->SetCurrExprAndPlan(pDft->currNode,
-                                                     pDft->currPlan);
-        mainWindow_->popUpContextMenu(QCursor::pos());
+        GlobGuiMainWindow->m_querydata->SetCurrExprAndPlan(pDft->currNode,
+                                                           pDft->currPlan);
+        GlobGuiMainWindow->popUpContextMenu(QCursor::pos());
     }
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/SqlCmpDbg.pro
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/SqlCmpDbg.pro 
b/core/sql/SqlCompilerDebugger/SqlCmpDbg.pro
index 09df424..6b1e10a 100644
--- a/core/sql/SqlCompilerDebugger/SqlCmpDbg.pro
+++ b/core/sql/SqlCompilerDebugger/SqlCmpDbg.pro
@@ -56,7 +56,10 @@ SOURCES += MainWindow.cpp \
     QueryAnalysisView.cpp \
     TDBDlgExprList.cpp \
     TDBDlgMdamNet.cpp \
-    vers_compilerDebugger.cpp
+    vers_compilerDebugger.cpp \
+    ExeSchedWindow.cpp \
+    TCBTreeView.cpp \
+    ExeQueueDisplay.cpp
 
 HEADERS  += MainWindow.h \
     BreakpointDialog.h \
@@ -73,7 +76,10 @@ HEADERS  += MainWindow.h \
     RulesDialog.h \
     QueryAnalysisView.h \
     TDBDlgExprList.h \
-    TDBDlgMdamNet.h
+    TDBDlgMdamNet.h \
+    ExeSchedWindow.h \
+    TCBTreeView.h \
+    ExeQueueDisplay.h
  
 FORMS    += MainWindow.ui \
     BreakpointDialog.ui \
@@ -87,7 +93,10 @@ FORMS    += MainWindow.ui \
     RulesDialog.ui \
     QueryAnalysisView.ui \
     TDBDlgExprList.ui \
-    TDBDlgMdamNet.ui
+    TDBDlgMdamNet.ui \
+    ExeSchedWindow.ui \
+    TCBTreeView.ui \
+    ExeQueueDisplay.ui
 
 RESOURCES += \
     Resource.qrc
@@ -119,7 +128,9 @@ INCLUDEPATH += ../eh \
                ../../sqf/export/include \
                ../../sqf/commonLogger \
                $$(LOG4CXX_INC_DIR) \
-               $$(LOG4CXX_INC_DIR)/lib4cxx
+               $$(LOG4CXX_INC_DIR)/lib4cxx \
+               $$(JAVA_HOME)/include \
+               $$(JAVA_HOME)/include/linux
 
 
 INCLUDEPATH += ../../sqf/sql/inc \

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/TCBTreeView.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/TCBTreeView.cpp 
b/core/sql/SqlCompilerDebugger/TCBTreeView.cpp
new file mode 100644
index 0000000..f3c67fa
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/TCBTreeView.cpp
@@ -0,0 +1,364 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#include <typeinfo>
+#include "TCBTreeView.h"
+#include "ExeSchedWindow.h"
+#include "ExeQueueDisplay.h"
+#include "ui_TCBTreeView.h"
+#include "CommonSqlCmpDbg.h"
+#include "ComTdb.h"
+#include "ex_tcb.h"
+#include "ExScheduler.h"
+
+TCBTreeView::TCBTreeView(ExeSchedWindow *mainExeWindow,
+                         QWidget *parent) :
+    QWidget(parent),
+    ui(new Ui::TCBTreeView),
+    mainExeWindow_(mainExeWindow)
+{
+    currTcb_ = NULL;
+    ui->setupUi(this);
+    QStringList header;
+    header << "TCB/Task Tree" << "Break" << "Scheduled" << "Down" << "Up";
+    QTreeWidgetItem *hdrItem = new QTreeWidgetItem(header);
+    hdrItem->setIcon(0, QIcon(":/file/Resource/Main/Sqlnode.bmp"));
+    ui->treeWidget->setHeaderItem(hdrItem);
+    ui->treeWidget->setSelectionBehavior(QAbstractItemView::SelectItems);
+    ui->treeWidget->setContextMenuPolicy(Qt::CustomContextMenu);
+    ui->treeWidget->setIconSize(QSize(32, 32));
+    ui->treeWidget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
+    ui->treeWidget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
+}
+
+TCBTreeView::~TCBTreeView()
+{
+    delete ui;
+}
+
+void TCBTreeView::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
+{
+  QVariant itemData = item->data(0, Qt::UserRole);
+  TcbTreeDetails *itemDetails = itemData.value <TcbTreeDetails *>();
+
+  switch (column)
+    {
+    case 0:
+      if (itemDetails->currTask)
+        {
+          // clicking on a task name:
+          // set the next task to be executed to this one
+          ExSubtask **subtaskPtr = mainExeWindow_->getSubtaskPtr();
+
+          if (subtaskPtr && *subtaskPtr)
+            *subtaskPtr = itemDetails->currTask;
+        }
+      break;
+
+    case 1:
+      if (itemDetails->currTask)
+        {
+          // clicking on a breakpoint cell of a task:
+          // toggle the breakpoint between on/off
+          int brkpt = itemDetails->currTask->getBreakPoint();
+
+          if (brkpt)
+            brkpt = 0;
+          else
+            brkpt = 1;
+          itemDetails->currTask->setBreakPoint(brkpt);
+        }
+      break;
+
+    case 2:
+      if (itemDetails->currTask)
+        // clicking on the "scheduled" field of a task: schedule
+        itemDetails->currTask->schedule();
+      break;
+
+    case 3:
+      if (itemDetails->currTask == NULL)
+        {
+          // clicking on the number of rows in the down queue:
+          if (!itemDetails->currDnQueueDisplay)
+            {
+              itemDetails->currDnQueueDisplay = new ExeQueueDisplay(
+                   itemDetails->currTcb,
+                   false,
+                   this);
+              itemDetails->currDnQueueDisplay->show();
+            }
+        }
+      break;
+
+    case 4:
+      if (itemDetails->currTask == NULL)
+        {
+          // clicking on the number of rows in the up queue:
+          if (!itemDetails->currUpQueueDisplay)
+            {
+              itemDetails->currUpQueueDisplay = new ExeQueueDisplay(
+                   itemDetails->currTcb,
+                   true,
+                   this);
+              itemDetails->currUpQueueDisplay->show();
+            }
+        }
+      break;
+
+    default:
+      break;
+    }
+
+  if (itemDetails->currTask)
+    setBreakSchedInfo(item,
+                      (itemDetails->currTask->getBreakPoint() > 0 ? 1 : 0),
+                      (itemDetails->currTask->isScheduled() ? "*" : ""));
+}
+
+void TCBTreeView::UpdateView()
+{
+    //------------------------------------------------------------------
+    // Delete the existing Tree.
+    //------------------------------------------------------------------
+}
+
+void TCBTreeView::displayTcbTree(const ex_tcb *tcb,
+                                 ExSubtask *currSubtask,
+                                 ExScheduler *sched,
+                                 bool includeTasks,
+                                 QTreeWidgetItem * parentTreeItem)
+{
+    if (parentTreeItem == NULL)
+      {
+        // for the top-level caller, start with the fragment root TCB
+        currTcb_ = tcb;
+        tcb = sched->getLocalRootTcbForGui();
+      }
+
+    if (tcb != NULL)
+      {
+        const ComTdb *tdb = tcb->getTdb();
+        int arity = tcb->numChildren();
+        Int32 bitmapIndex;
+        QString nodeText;
+        const char *breakText = " ";
+        const char *scheduledText = " ";
+        TcbTreeDetails *itemDetails = new TcbTreeDetails(tcb, sched);
+
+        getOperatorImageText(tdb, bitmapIndex, nodeText);
+
+        QStringList rowValues;
+        ex_queue_pair parentQueue = tcb->getParentQueue();
+        rowValues.append(nodeText);
+        QTreeWidgetItem *tcbTreeItem = new QTreeWidgetItem(rowValues);
+
+        if (parentQueue.down)
+          {
+            tcbTreeItem->setText(3, 
QString("%1").arg(parentQueue.down->getLength()));
+            if (parentQueue.down->isFull())
+              tcbTreeItem->setBackgroundColor(3, QColor("mistyrose"));
+          }
+        if (parentQueue.up)
+          {
+            tcbTreeItem->setText(4, 
QString("%1").arg(parentQueue.up->getLength()));
+            if (parentQueue.up->isFull())
+              tcbTreeItem->setBackgroundColor(4, QColor("mistyrose"));
+          }
+
+        tcbTreeItem->setIcon(0, QIcon(":/file/Resource/Main/Sqlnode.bmp"));
+        QString tip = 
QString("%1@0x%2").arg(typeid(*tcb).name()).arg((ulong)tcb, 0, 16);
+        tcbTreeItem->setToolTip(0, tip);
+        if (tcb == currTcb_ && !includeTasks)
+          tcbTreeItem->setBackgroundColor(0, QColor("salmon"));
+        if (parentTreeItem == NULL)
+          {
+            ui->treeWidget->clear();
+            ui->treeWidget->addTopLevelItem(tcbTreeItem);
+          }
+        else
+          {
+            parentTreeItem->addChild(tcbTreeItem);
+          }
+
+        itemDetails->currTcb = tcb;
+        itemDetails->currSched = sched;
+        itemDetails->currTask = NULL;
+        QVariant itemData = qVariantFromValue(itemDetails);
+        tcbTreeItem->setData(0, Qt::UserRole, itemData);
+        //set column alignment for each row
+        tcbTreeItem->setTextAlignment(1, Qt::AlignCenter | Qt::AlignVCenter);
+        tcbTreeItem->setTextAlignment(2, Qt::AlignCenter | Qt::AlignVCenter);
+
+        if (nodeText.compare(QString("NULL")))
+          {
+            tcbTreeItem->setText(1, QString(breakText));
+            tcbTreeItem->setText(2, QString(scheduledText));
+          }
+
+        displayTcbTasks(tcb, currSubtask, sched, includeTasks, tcbTreeItem);
+
+        for (Int32 i = arity - 1; i >= 0; i--)
+          {
+            const ex_tcb *childTcb = tcb->getChild(i);
+
+            displayTcbTree(childTcb, currSubtask, sched, includeTasks, 
tcbTreeItem);
+          }
+        if (parentTreeItem == NULL)
+          {
+            // make some final adjustments
+            ui->treeWidget->expandAll();
+            for (int i = 0; i < ui->treeWidget->columnCount(); i++)
+              {
+                ui->treeWidget->resizeColumnToContents(i);
+                int width = ui->treeWidget->columnWidth(i);
+                if (i == 2 && width > 70)
+                  // restrict the last column (breakpoints)
+                  // to a small size, otherwise the resize
+                  // process expands it all the way
+                  width = 70;
+                ui->treeWidget->setColumnWidth(i, width + 20);
+              }
+          }
+      }  //tdbTree != NULL
+}
+
+void TCBTreeView::displayTcbTasks(const ex_tcb *tcb,
+                                  ExSubtask *currSubtask,
+                                  ExScheduler *sched,
+                                  bool expandTasks,
+                                  QTreeWidgetItem *tcbTreeItem)
+{
+   ExSubtask *subtask = sched->getSubtasksForGui();
+   int numBreakpoints = 0;
+   std::string isScheduled;
+   while (subtask)
+     {
+       if (subtask->getTcb() == tcb)
+         {
+           if (expandTasks)
+             {
+               QString nodeTextData = 
QString(QLatin1String(subtask->getTaskName()));
+               QStringList rowValues;
+               rowValues.append(nodeTextData);
+               QTreeWidgetItem *taskTreeItem = new QTreeWidgetItem(rowValues);
+               TcbTreeDetails *itemDetails = new TcbTreeDetails(tcb, sched, 
subtask);
+
+               taskTreeItem->setIcon(0, QIcon(":/file/Resource/Main/T.bmp"));
+               QString tip = 
QString("%1@0x%2").arg(typeid(*subtask).name()).arg((ulong)subtask, 0, 16);
+               taskTreeItem->setToolTip(0, tip);
+               tcbTreeItem->addChild(taskTreeItem);
+
+               itemDetails->currTcb = tcb;
+               itemDetails->currSched = sched;
+               itemDetails->currTask = subtask;
+               QVariant itemData = qVariantFromValue(itemDetails);
+               taskTreeItem->setData(0, Qt::UserRole, itemData);
+               //set column alignment for each row
+               taskTreeItem->setTextAlignment(1, Qt::AlignCenter | 
Qt::AlignVCenter);
+               taskTreeItem->setTextAlignment(2, Qt::AlignCenter | 
Qt::AlignVCenter);
+
+               if (nodeTextData.compare(QString("NULL")))
+                 {
+                   setBreakSchedInfo(taskTreeItem,
+                                     (subtask->getBreakPoint() > 0 ? 1 : 0),
+                                     (subtask->isScheduled() ? "*" : ""));
+                   if (subtask == currSubtask)
+                     taskTreeItem->setBackgroundColor(0, QColor("salmon"));
+                 }
+             } // expandTasks
+           else
+             {
+               // aggregate breakpoint and scheduled information at the task 
level
+               if (subtask->isScheduled())
+                 numBreakpoints++;
+               if (subtask->getBreakPoint() > 0)
+                 {
+                   std::string taskText(subtask->getTaskName());
+
+                   if (taskText.length() == 0 || taskText.at(0) == ' ')
+                     taskText = "*";
+                   taskText.append(",");
+                   if (isScheduled.find(taskText) != std::string::npos)
+                     {
+                       isScheduled.append(subtask->getTaskName());
+                       isScheduled.append(",");
+                     }
+                 }
+             } // don't list tasks in the tree view
+         } // task is for the current TCB
+       subtask = subtask->getNextForGUI();
+     } // loop over all subtasks
+   setBreakSchedInfo(tcbTreeItem, numBreakpoints, isScheduled.c_str());
+}
+
+void TCBTreeView::getOperatorImageText (const ComTdb *tdb,
+                                        Int32 & bitmapIndex,
+                                        QString &nodeText)
+{
+    nodeText = QString("%1 (Id: %2 Ex: %3)").
+                arg(tdb->getNodeName()).
+                arg(tdb->getTdbId()).
+                arg(tdb->getExplainNodeId());
+    ComTdb::ex_node_type opType = tdb->getNodeType();
+    switch (opType)
+      {
+      case ComTdb::ex_ROOT:
+        bitmapIndex = IDX_ROOT;
+        break;
+      case ComTdb::ex_ONLJ:
+      case ComTdb::ex_MJ:
+      case ComTdb::ex_HASHJ:
+      case ComTdb::ex_TUPLE_FLOW:
+        bitmapIndex = IDX_JOIN;
+        break;
+      case ComTdb::ex_HBASE_ACCESS:
+      case ComTdb::ex_HDFS_SCAN:
+        bitmapIndex = IDX_SCAN;
+        break;
+      default:
+        bitmapIndex = IDX_GENERIC;
+      }
+}
+
+void TCBTreeView::setBreakSchedInfo(QTreeWidgetItem *treeItem,
+                                    int numBreakpoints,
+                                    const char *schedTasks)
+{
+    std::string schedText(schedTasks);
+
+    if (numBreakpoints > 0)
+      {
+        treeItem->setText(1, QString("*"));
+        treeItem->setBackgroundColor(1,"orangered");
+      }
+    else
+      {
+        treeItem->setText(1, QString(" "));
+      }
+    if (schedText.length() > 0 && schedText.at(schedText.length()-1) == ',')
+      schedText.erase(schedText.length()-1);
+    if (schedText.length() > 16)
+      schedText = "*";
+    treeItem->setText(2, QString(schedText.c_str()));
+    if (schedText.length() > 0)
+      treeItem->setBackgroundColor(2,"lightblue");
+}
+

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/TCBTreeView.h
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/TCBTreeView.h 
b/core/sql/SqlCompilerDebugger/TCBTreeView.h
new file mode 100644
index 0000000..276723b
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/TCBTreeView.h
@@ -0,0 +1,98 @@
+// @@@ START COPYRIGHT @@@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+// @@@ END COPYRIGHT @@@
+#ifndef TCBTREEVIEW_H
+#define TCBTREEVIEW_H
+
+#include <QtGui>
+#include "CommonSqlCmpDbg.h"
+
+namespace Ui {
+class TCBTreeView;
+}
+
+class ex_tcb;
+class ExScheduler;
+class ExSubtask;
+class ExeQueueDisplay;
+class ExeSchedWindow;
+
+struct TcbTreeDetails : public QObject
+{
+  const ex_tcb *currTcb;
+  ExScheduler *currSched;
+  ExSubtask *currTask;
+  ExeQueueDisplay *currDnQueueDisplay;
+  ExeQueueDisplay *currUpQueueDisplay;
+
+  TcbTreeDetails(const ex_tcb *tcb,
+                 ExScheduler *sched,
+                 ExSubtask *subtask = NULL)
+  {
+    currTcb = tcb;
+    currSched = sched;
+    currTask = subtask;
+    currDnQueueDisplay = NULL;
+    currUpQueueDisplay = NULL;
+  }
+
+};
+
+Q_DECLARE_METATYPE (TcbTreeDetails *); // This is for QTreeWidgetItem.setData()
+
+class TCBTreeView : public QWidget
+{
+    Q_OBJECT
+
+public:
+    explicit TCBTreeView(ExeSchedWindow *mainExeWindow,
+                         QWidget *parent = 0);
+    ~TCBTreeView();
+
+  void UpdateView();
+  void displayTcbTree(const ex_tcb *tcb,
+                      ExSubtask *currSubtask,
+                      ExScheduler *sched,
+                      bool includeTasks = true,
+                      QTreeWidgetItem *parentTreeItem = NULL);
+
+private slots:
+    void on_treeWidget_itemClicked(QTreeWidgetItem *item, int column);
+
+private:
+    Ui::TCBTreeView *ui;
+
+    void displayTcbTasks(const ex_tcb *tcb,
+                         ExSubtask *currSubtask,
+                         ExScheduler *sched,
+                         bool expandTasks,
+                         QTreeWidgetItem *tcbTreeItem);
+    void getOperatorImageText(const ComTdb *tdb,
+                              Int32 & bitmapIndex,
+                              QString &nodeText);
+    void setBreakSchedInfo(QTreeWidgetItem *treeItem,
+                           int numBreakpoints,
+                           const char *schedTasks);
+    // currently active TCB and subtask
+    const ex_tcb *currTcb_;
+    ExeSchedWindow *mainExeWindow_;
+};
+
+#endif // TCBTREEVIEW_H

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/TCBTreeView.ui
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/TCBTreeView.ui 
b/core/sql/SqlCompilerDebugger/TCBTreeView.ui
new file mode 100644
index 0000000..5721c82
--- /dev/null
+++ b/core/sql/SqlCompilerDebugger/TCBTreeView.ui
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<ui version="4.0">
+ <class>TCBTreeView</class>
+ <widget class="QWidget" name="TCBTreeView">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>418</width>
+    <height>249</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="leftMargin">
+    <number>2</number>
+   </property>
+   <property name="topMargin">
+    <number>2</number>
+   </property>
+   <property name="rightMargin">
+    <number>2</number>
+   </property>
+   <property name="bottomMargin">
+    <number>2</number>
+   </property>
+   <item>
+    <widget class="QScrollArea" name="scrollArea">
+     <property name="verticalScrollBarPolicy">
+      <enum>Qt::ScrollBarAlwaysOn</enum>
+     </property>
+     <property name="horizontalScrollBarPolicy">
+      <enum>Qt::ScrollBarAlwaysOn</enum>
+     </property>
+     <property name="widgetResizable">
+      <bool>true</bool>
+     </property>
+     <widget class="QWidget" name="scrollAreaWidgetContents">
+      <property name="geometry">
+       <rect>
+        <x>0</x>
+        <y>0</y>
+        <width>397</width>
+        <height>228</height>
+       </rect>
+      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <widget class="QTreeWidget" name="treeWidget">
+         <attribute name="headerVisible">
+          <bool>true</bool>
+         </attribute>
+         <attribute name="headerDefaultSectionSize">
+          <number>104</number>
+         </attribute>
+         <column>
+          <property name="text">
+           <string notr="true">1</string>
+          </property>
+         </column>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/SqlCompilerDebugger/TDBTreeView.cpp
----------------------------------------------------------------------
diff --git a/core/sql/SqlCompilerDebugger/TDBTreeView.cpp 
b/core/sql/SqlCompilerDebugger/TDBTreeView.cpp
index e883494..df1ccd8 100644
--- a/core/sql/SqlCompilerDebugger/TDBTreeView.cpp
+++ b/core/sql/SqlCompilerDebugger/TDBTreeView.cpp
@@ -25,7 +25,8 @@
 #include "TDBDlgMdamNet.h"
 #include "TDBDlgExprList.h"
 
-extern MainWindow *mainWindow_;
+// defined in MainWindow.cpp
+extern MainWindow *GlobGuiMainWindow;
 
 TDBTreeView::TDBTreeView(QWidget * parent):
 QWidget(parent), ui(new Ui::TDBTreeView)
@@ -175,7 +176,7 @@ void TDBTreeView::UpdateView()
   ExFragDir* fragDir;
   Lng32 baseAddr;
 
-  mainWindow_->m_querydata->GetTDBData((void**) &tdb, (void**) &fragDir, 
baseAddr);
+  GlobGuiMainWindow->m_querydata->GetTDBData((void**) &tdb, (void**) &fragDir, 
baseAddr);
   //------------------------------------------------------------------
   // GSH : Delete the existing Tree.
   //------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/bin/SqlciErrors.txt
----------------------------------------------------------------------
diff --git a/core/sql/bin/SqlciErrors.txt b/core/sql/bin/SqlciErrors.txt
index 0de8a4e..2cdf4a4 100644
--- a/core/sql/bin/SqlciErrors.txt
+++ b/core/sql/bin/SqlciErrors.txt
@@ -670,6 +670,7 @@
 2242 ZZZZZ 99999 BEGINNER MINOR LOGONLY Compiler process unable to log its 
status and health information to the repository.
 2243 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Using DISPLAY in trafci or DBMgr is 
not supported.
 2244 ZZZZZ 99999 BEGINNER MAJOR DBADMIN ULOG file path invalid : $0~string0.
+2245 ZZZZZ 99999 BEGINNER MAJOR DBADMIN Error loading 
libSqlCompilerDebugger.so DLL for the display GUI: $0~string0.
 2900 ZZZZZ 99999 BEGINNER MAJOR DBADMIN in file $0~string0 at line $1~int0:
 2980 ZZZZZ 99999 BEGINNER MAJOR DBADMIN ? Option -g requires an argument.
 2981 ZZZZZ 99999 BEGINNER MAJOR DBADMIN ? Unrecognized argument in option -g

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index 3d5f033..00c38a1 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -6406,31 +6406,37 @@ Lng32 CopyOneStmtAttr (/*IN*/   Statement &stmt,
   }
   else if (attrName == SQL_ATTR_QUERY_TYPE)
   {
-    //for display query e.g. display select ...
-    //just return SUCCESS to suppress error message
-    if(stmt.isDISPLAY())
-    {
-      return SQLCLI_ReturnCode(&context, DISPLAY_DONE_WARNING);
-    }
     if (!stmt.getRootTdb())
     {
-      diags << DgSqlCode(-CLI_STMT_NOT_EXISTS);
-      return SQLCLI_ReturnCode(&context, -CLI_STMT_NOT_EXISTS);
+      //for display query e.g. display select ...
+      //just return SUCCESS to suppress error message
+      if(stmt.isDISPLAY())
+        {
+          return SQLCLI_ReturnCode(&context, DISPLAY_DONE_WARNING);
+        }
+      else
+        {
+          diags << DgSqlCode(-CLI_STMT_NOT_EXISTS);
+          return SQLCLI_ReturnCode(&context, -CLI_STMT_NOT_EXISTS);
+        }
     }
     *numeric_value = stmt.getRootTdb()->getQueryType();
   }
   else if (attrName == SQL_ATTR_SUBQUERY_TYPE)
   {
-    //for display query e.g. display select ...
-    //just return SUCCESS to suppress error message
-    if(stmt.isDISPLAY())
-    {
-      return SQLCLI_ReturnCode(&context, DISPLAY_DONE_WARNING);
-    } 
     if (!stmt.getRootTdb())
     {
-      diags << DgSqlCode(-CLI_STMT_NOT_EXISTS);
-      return SQLCLI_ReturnCode(&context, -CLI_STMT_NOT_EXISTS);
+      //for display query e.g. display select ...
+      //just return SUCCESS to suppress error message
+      if(stmt.isDISPLAY())
+        {
+          return SQLCLI_ReturnCode(&context, DISPLAY_DONE_WARNING);
+        }
+      else
+        {
+          diags << DgSqlCode(-CLI_STMT_NOT_EXISTS);
+          return SQLCLI_ReturnCode(&context, -CLI_STMT_NOT_EXISTS);
+        }
     }
     *numeric_value = stmt.getRootTdb()->getSubqueryType();
   }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/comexe/ComTdbRoot.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbRoot.h b/core/sql/comexe/ComTdbRoot.h
index f35ce54..d5def37 100644
--- a/core/sql/comexe/ComTdbRoot.h
+++ b/core/sql/comexe/ComTdbRoot.h
@@ -41,7 +41,6 @@
 #include "ComTdb.h"
 #include "SqlTableOpenInfo.h" // for SqlTableOpenInfo
 #include "exp_expr.h" // for InputOutputExpr
-#include "ComSqlexedbg.h" // for SqlexeDbgExpFuncs
 #include "FragDir.h"
 #include "LateBindInfo.h"
 #include "ComTransInfo.h"

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/common/ComSqlcmpdbg.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSqlcmpdbg.h b/core/sql/common/ComSqlcmpdbg.h
index 092abf0..10e6efd 100644
--- a/core/sql/common/ComSqlcmpdbg.h
+++ b/core/sql/common/ComSqlcmpdbg.h
@@ -28,7 +28,7 @@
  * File:         ComSqlcmpdbg.h
  * Description:  This file contains declarations common to arkcmp components   
  *               and tdm_sqlcmpdbg, the GUI tool used to display query
- *              compilation.
+ *              compilation and execution.
  *
  * Created:      06/25/97
  * Modified:     $Author:
@@ -39,7 +39,10 @@
  *****************************************************************************
  */
 
-#include "Platform.h"  // 64-BIT
+#include "Platform.h"
+
+class ExScheduler;
+class ExSubtask;
 
 class Sqlcmpdbg {
   // This class exists merely to give a nice naming scope for this enum
@@ -62,17 +65,19 @@ public:
                         };
 };
 
-typedef struct tagSqlcmpdbgExpFuncs {
+struct SqlcmpdbgExpFuncs {
   void (*fpDisplayQueryTree) (Sqlcmpdbg::CompilationPhase,void* , void* );
-  void (*fpSqldbgSetPointers) (void*, void*, void*, void*, void* );
+  void (*fpSqldbgSetCmpPointers) (void*, void*, void*, void*, void* );
   void (*fpDoMemoStep) (Int32, Int32, Int32, void*, void*, void*);
   void (*fpHideQueryTree) (BOOL);
   void (*fpDisplayTDBTree) (Sqlcmpdbg::CompilationPhase, void*, void*);
-  BOOL (*fpDisplayExecution) (void);
+  int  (*fpExecutionDisplayIsEnabled) (void);
+  void (*fpSqldbgSetExePointers) (void *, void *, void *);
+  void (*fpDisplayExecution) (ExSubtask**, ExScheduler *);
   void (*fpCleanUp)(void);
-} SqlcmpdbgExpFuncs;
+};
 
-typedef SqlcmpdbgExpFuncs* (*fpGetSqlcmpdbgExpFuncs) (void); 
+typedef SqlcmpdbgExpFuncs* (*fpGetSqlcmpdbgExpFuncs) ();
 
 #endif
        

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/common/ComSqlexedbg.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSqlexedbg.h b/core/sql/common/ComSqlexedbg.h
deleted file mode 100644
index 4e13606..0000000
--- a/core/sql/common/ComSqlexedbg.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef COMSQLEXEDBG_H
-#define COMSQLEXEDBG_H
-/* -*-C++-*-
- *****************************************************************************
- *
- * File:         ComSqlcmpdbg.h
- * Description:  This file contains declarations common to arkcmp components   
- *               and tdm_sqlcmpdbg the GUI tool used to display query 
- *               compilation.
- *               
- * Created:      06/25/97
- * Modified:     $Author:
- * Language:     C++
- *
- *
-// @@@ START COPYRIGHT @@@
-//
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-//
-// @@@ END COPYRIGHT @@@
- *
- *
- *****************************************************************************
- */
-
-// forward reference
-class ExSubtask;
-class ExScheduler;
-class ex_tcb;
-
-typedef struct tagSqlexedbgExpFuncs {
-  void (*fpDisplayTCBTree) (ExSubtask**, ExScheduler*);
-  void (*fpSetRootTCB) (ex_tcb*);
-} SqlexedbgExpFuncs;
-
-typedef SqlexedbgExpFuncs* (*fpGetSqlexedbgExpFuncs) (void); 
-
-#endif
-       

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4f3b0e8c/core/sql/common/Ipc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/Ipc.cpp b/core/sql/common/Ipc.cpp
index 7807778..06b0ad9 100644
--- a/core/sql/common/Ipc.cpp
+++ b/core/sql/common/Ipc.cpp
@@ -368,6 +368,14 @@ IpcCpuNum IpcProcessId::getCpuNum() const
     }
 }
 
+std::string IpcProcessId::toString() const
+{
+  char outb[100];
+
+  toAscii(outb, sizeof(outb));
+  return outb;
+}
+
 Int32 IpcProcessId::toAscii(char *outBuf, Int32 outBufLen) const
 {
   // process names shouldn't be longer than 300 bytes

Reply via email to