Repository: trafodion
Updated Branches:
  refs/heads/master ebc847eaf -> c2e71b2f7


http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/executor/ex_root.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_root.cpp b/core/sql/executor/ex_root.cpp
index 38654b3..594174d 100644
--- a/core/sql/executor/ex_root.cpp
+++ b/core/sql/executor/ex_root.cpp
@@ -997,7 +997,7 @@ void ex_root_tcb::setupWarning(Lng32 retcode, const char * 
str,
     ExRaiseSqlWarning(getHeap(), &newDiags, (ExeErrorCode) (8448), NULL,
         &intParam1, &cliError, NULL, (str ? (char*) str : (char*) " "),
         getHbaseErrStr(retcode),
-        (str2 ? (char*) str2 : (char *) currContext->getJniErrorStr().data()));
+        (str2 ? (char*) str2 : (char *) GetCliGlobals()->getJniErrorStr()));
     diagsArea->mergeAfter(*newDiags);
   }
   ex_assert( 0, "invalid return code value");

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/executor/hiveHook.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/hiveHook.cpp b/core/sql/executor/hiveHook.cpp
index 11003f9..d734287 100644
--- a/core/sql/executor/hiveHook.cpp
+++ b/core/sql/executor/hiveHook.cpp
@@ -212,7 +212,7 @@ NABoolean HiveMetaData::recordError(Int32 errCode,
       if (client_)
         errCodeStr_ = client_->getErrorText((HVC_RetCode)errCode_);
       errMethodName_ = errMethodName;
-      errDetail_ = GetCliGlobals()->getJniErrorStrPtr();
+      errDetail_ = GetCliGlobals()->getJniErrorStr();
       return FALSE;
     }
   return TRUE;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/optimizer/NATable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/NATable.cpp b/core/sql/optimizer/NATable.cpp
index cb0cc39..ed11edb 100644
--- a/core/sql/optimizer/NATable.cpp
+++ b/core/sql/optimizer/NATable.cpp
@@ -7878,7 +7878,7 @@ ExpHbaseInterface* NATable::getHBaseInterfaceRaw()
         << DgString0((char*)"ExpHbaseInterface::init()")
         << DgString1(getHbaseErrStr(-retcode))
         << DgInt0(-retcode)
-        << DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+        << DgString2((char*)GetCliGlobals()->getJniErrorStr());
       delete ehi;
       return NULL;
     }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp 
b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index 0dc36e5..6fc1863 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -1146,7 +1146,7 @@ ExpHbaseInterface* CmpSeabaseDDL::allocEHI(const char * 
server,
                           << DgString0((char*)"ExpHbaseInterface::init()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       }
 
       deallocEHI(ehi); 
@@ -1425,7 +1425,7 @@ short CmpSeabaseDDL::validateVersions(NADefaults *defs,
         *hbaseErrNum = retcode;
 
       if (hbaseErrStr)
-        *hbaseErrStr = (char*)GetCliGlobals()->getJniErrorStr().data();
+        *hbaseErrStr = (char*)GetCliGlobals()->getJniErrorStr();
 
       retcode = -1398;
       goto label_return;
@@ -1500,7 +1500,7 @@ short CmpSeabaseDDL::validateVersions(NADefaults *defs,
         *hbaseErrNum = retcode;
 
       if (hbaseErrStr)
-        *hbaseErrStr = (char*)GetCliGlobals()->getJniErrorStr().data();
+        *hbaseErrStr = (char*)GetCliGlobals()->getJniErrorStr();
 
       retcode = -1398;
       goto label_return;
@@ -2557,7 +2557,7 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface 
*ehi,
                           << DgString0((char*)"ExpHbaseInterface::exists()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       
       return -1;
     }
@@ -2615,7 +2615,7 @@ short CmpSeabaseDDL::createHbaseTable(ExpHbaseInterface 
*ehi,
                           << DgString0((char*)"ExpHbaseInterface::create()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       
       return -1;
     }
@@ -2695,7 +2695,7 @@ short CmpSeabaseDDL::alterHbaseTable(ExpHbaseInterface 
*ehi,
                               << DgString0((char*)"ExpHbaseInterface::alter()")
                               << DgString1(getHbaseErrStr(-retcode))
                               << DgInt0(-retcode)
-                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
           retcode = -1;
         } // if
     } // else
@@ -2723,7 +2723,7 @@ short CmpSeabaseDDL::dropHbaseTable(ExpHbaseInterface 
*ehi,
                               << DgString0((char*)"ExpHbaseInterface::drop()")
                               << DgString1(getHbaseErrStr(-retcode))
                               << DgInt0(-retcode)
-                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
           
           return -1;
         }
@@ -2735,7 +2735,7 @@ short CmpSeabaseDDL::dropHbaseTable(ExpHbaseInterface 
*ehi,
                           << DgString0((char*)"ExpHbaseInterface::exists()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       
       return -1;
     }
@@ -2758,7 +2758,7 @@ short CmpSeabaseDDL::copyHbaseTable(ExpHbaseInterface 
*ehi,
                               << DgString0((char*)"ExpHbaseInterface::copy()")
                               << DgString1(getHbaseErrStr(-retcode))
                               << DgInt0(-retcode)
-                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
           
           return -1;
         }
@@ -2770,7 +2770,7 @@ short CmpSeabaseDDL::copyHbaseTable(ExpHbaseInterface 
*ehi,
                           << DgString0((char*)"ExpHbaseInterface::copy()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       
       return -1;
     }
@@ -8127,7 +8127,7 @@ short CmpSeabaseDDL::dropSeabaseObjectsFromHbase(const 
char * pattern,
                           << DgString0((char*)"ExpHbaseInterface::dropAll()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
 
       return retcode;
     }
@@ -8638,7 +8638,7 @@ short CmpSeabaseDDL::truncateHbaseTable(const NAString 
&catalogNamePart,
                           << DgString0((char*)"ExpHbaseInterface::truncate()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
 
       processReturn();
       return -1;

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp 
b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
index b16f777..0794d5d 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLtable.cpp
@@ -4820,7 +4820,7 @@ void CmpSeabaseDDL::renameSeabaseTable(
                           << DgString0((char*)"ExpHbaseInterface::copy()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
       
       processReturn();
       
@@ -6264,7 +6264,7 @@ short CmpSeabaseDDL::hbaseFormatTableDropColumn(
                             << 
DgString0((char*)"ExpHbaseInterface::deleteColumns()")
                             << DgString1(getHbaseErrStr(-cliRC))
                             << DgInt0(-cliRC)
-                            << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                            << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
         
         goto label_error;
       }
@@ -10152,7 +10152,7 @@ void CmpSeabaseDDL::hbaseGrantRevoke(
                                   
DgString0((char*)"ExpHbaseInterface::revoke()"))
                               << DgString1(getHbaseErrStr(-retcode))
                               << DgInt0(-retcode)
-                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                              << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
 
           deallocEHI(ehi);
 
@@ -10169,7 +10169,7 @@ void CmpSeabaseDDL::hbaseGrantRevoke(
                           << DgString0((char*)"ExpHbaseInterface::close()")
                           << DgString1(getHbaseErrStr(-retcode))
                           << DgInt0(-retcode)
-                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+                          << 
DgString2((char*)GetCliGlobals()->getJniErrorStr());
 
       deallocEHI(ehi);
 
@@ -12592,7 +12592,7 @@ TrafDesc * CmpSeabaseDDL::getSeabaseUserTableDesc(const 
NAString &catName,
             << DgString0((char*)"ExpHbaseInterface::getLatestSnapshot()")
             << DgString1(getHbaseErrStr(-retcode))
             << DgInt0(-retcode)
-            << DgString2((char*)GetCliGlobals()->getJniErrorStr().data());
+            << DgString2((char*)GetCliGlobals()->getJniErrorStr());
           delete ehi;
         }
     }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/src/main/java/org/trafodion/sql/HTableClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HTableClient.java 
b/core/sql/src/main/java/org/trafodion/sql/HTableClient.java
index 7dae2b8..c228c36 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HTableClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HTableClient.java
@@ -114,7 +114,6 @@ public class HTableClient {
        private ResultScanner scanner = null;
         private ScanHelper scanHelper = null;
        Result[] getResultSet = null;
-       String lastError;
         RMInterface table = null;
         private boolean writeToWAL = false;
        int numRowsCached = 1;
@@ -352,16 +351,6 @@ public class HTableClient {
            return true;
        }
 
-       public String getLastError() {
-               String ret = lastError;
-               lastError = null;
-               return ret;
-       }
-
-       void setLastError(String err) {
-               lastError = err;
-       }
-
        String getTableName() {
                return tableName;
        }
@@ -1188,10 +1177,7 @@ public class HTableClient {
                else
                {
                        if (scanner == null) {
-                               String err = "  fetchRows() called before 
scanOpen().";
-                               logger.error(err);
-                               setLastError(err);
-                               return -1;
+                                throw new 
IOException("HTableClient.FetchRows() called before scanOpen().");
                        }
                        Result[] result = null;
                        if (preFetch)

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/src/main/java/org/trafodion/sql/HiveClient.java
----------------------------------------------------------------------
diff --git a/core/sql/src/main/java/org/trafodion/sql/HiveClient.java 
b/core/sql/src/main/java/org/trafodion/sql/HiveClient.java
index 13ee51d..6657aed 100644
--- a/core/sql/src/main/java/org/trafodion/sql/HiveClient.java
+++ b/core/sql/src/main/java/org/trafodion/sql/HiveClient.java
@@ -167,9 +167,8 @@ public class HiveClient {
     }
 
     public Object[] getAllTables(String schName) 
-        throws MetaException, Exception {
-        //System.out.println("schName = " + schName);
-
+        throws MetaException, TException {
+        try {
         Database db = hmsClient.getDatabase(schName);
         if (db == null)
             return null;
@@ -179,6 +178,9 @@ public class HiveClient {
            return tableList.toArray();
         else
            return null;
+        } catch (NoSuchObjectException e) {
+          return null;
+        }
     }
 
     // Because Hive changed the name of the class containing internal 
constants changed

http://git-wip-us.apache.org/repos/asf/trafodion/blob/073cf68d/core/sql/ustat/hs_cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/ustat/hs_cli.cpp b/core/sql/ustat/hs_cli.cpp
index e4d4761..298e9cf 100644
--- a/core/sql/ustat/hs_cli.cpp
+++ b/core/sql/ustat/hs_cli.cpp
@@ -503,7 +503,7 @@ Lng32 HSClearCLIDiagnostics()
 // Obtain any JNI diagnostic text stored in the CLI
 const char * HSFuncGetJniErrorStr()
 {
-  return GetCliGlobals()->currContext()->getJniErrorStrPtr();
+  return GetCliGlobals()->getJniErrorStr();
 }
 
 // -----------------------------------------------------------------------

Reply via email to