Repository: trafodion
Updated Branches:
  refs/heads/master 58bd5757a -> d6e29337a


[TRAFODION-3009] Streamline error handling in Executor utility commands

seabase/TEST002 failing with a core file. Yet another attempt to fix this issue.


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

Branch: refs/heads/master
Commit: fc03afc85054bee88944f89ee2076b4c6dd64ba7
Parents: 4297cac
Author: selvaganesang <[email protected]>
Authored: Tue Apr 10 21:29:47 2018 +0000
Committer: selvaganesang <[email protected]>
Committed: Tue Apr 10 21:29:47 2018 +0000

----------------------------------------------------------------------
 core/sql/executor/ExExeUtilCommon.cpp                     | 3 ++-
 core/sql/executor/ExExeUtilGet.cpp                        | 5 ++++-
 core/sql/src/main/java/org/trafodion/sql/HBaseClient.java | 3 ++-
 3 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/fc03afc8/core/sql/executor/ExExeUtilCommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCommon.cpp 
b/core/sql/executor/ExExeUtilCommon.cpp
index 450dd74..d6af9a7 100644
--- a/core/sql/executor/ExExeUtilCommon.cpp
+++ b/core/sql/executor/ExExeUtilCommon.cpp
@@ -1458,7 +1458,8 @@ short ExExeUtilTcb::alterAuditFlag(NABoolean audited, 
char * tableName,
 short ExExeUtilTcb::handleError()
 {
   short rc = ex_tcb::handleError(&qparent_, getDiagsArea());
-  diagsArea_->deAllocate();
+  if (diagsArea_ != NULL)
+     diagsArea_->deAllocate();
   diagsArea_ = NULL;
   return rc;
 }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/fc03afc8/core/sql/executor/ExExeUtilGet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilGet.cpp 
b/core/sql/executor/ExExeUtilGet.cpp
index 10dd05f..768d08b 100644
--- a/core/sql/executor/ExExeUtilGet.cpp
+++ b/core/sql/executor/ExExeUtilGet.cpp
@@ -6550,8 +6550,11 @@ short ExExeUtilRegionStatsFormatTcb::work()
 
         case COLLECT_STATS_:
           {
-            if (collectStats(tableName_))
+            if (collectStats(tableName_) < 0)
               {
+                ExRaiseSqlError(getHeap(), &diagsArea_, -8451,
+                     NULL, NULL, NULL,
+                     getSqlJniErrorStr());
                 step_ = HANDLE_ERROR_;
                 break;
               }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/fc03afc8/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java 
b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
index e1dce7b..ffb42a2 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HBaseClient.java
@@ -880,7 +880,7 @@ public class HBaseClient {
                     String encodedRegionName = hregInfo.getEncodedName();
                     String ppRegionName = 
HRegionInfo.prettyPrint(encodedRegionName);
                     SizeInfo regionSizeInfo  = 
rsc.getRegionSizeInfo(regionName);
-                    String serverNameStr     = regionSizeInfo.serverName;
+                    String serverNameStr     = "";
                     int  numStores           = 0;
                     int  numStoreFiles       = 0;
                     long storeUncompSize     = 0;
@@ -890,6 +890,7 @@ public class HBaseClient {
                     long writeRequestsCount  = 0;
                     String ppTableName = "";
                     if (regionSizeInfo != null) {
+                       serverNameStr       = regionSizeInfo.serverName;
                        numStores           = regionSizeInfo.numStores;
                        numStoreFiles       = regionSizeInfo.numStoreFiles;
                        storeUncompSize     = regionSizeInfo.storeUncompSize;

Reply via email to