fix the nullpointer error scaned by TScanCode

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

Branch: refs/heads/master
Commit: b32351ff93e44a346f8dfb15c0ea9afa748f62a6
Parents: 8e332e5
Author: Kenny <[email protected]>
Authored: Tue Jan 9 05:06:30 2018 +0000
Committer: Kenny <[email protected]>
Committed: Tue Jan 9 05:06:30 2018 +0000

----------------------------------------------------------------------
 core/conn/jdbc_type2/native/SqlInterface.cpp    |  12 +-
 core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp |   6 +-
 core/conn/trafci/Makefile.bak                   |  41 +
 core/sqf/sql/scripts/DUMPENVS                   | 884 +++++++++++++++++++
 core/sqf/src/seabed/src/fsi.cpp                 |   8 +-
 core/sqf/src/seabed/src/msmon.cpp               |   7 +-
 core/sql/cli/Context.cpp                        |   3 +-
 core/sql/cli/ExSqlComp.cpp                      |   2 +-
 core/sql/cli/Globals.cpp                        |   4 +-
 core/sql/executor/ExExplain.cpp                 |   6 +-
 core/sql/executor/ExStats.cpp                   |   3 +-
 core/sql/executor/cluster.cpp                   |   2 +-
 core/sql/optimizer/BindItemExpr.cpp             |  12 +-
 core/sql/optimizer/MVInfo.cpp                   |   6 +-
 core/sql/optimizer/OptPhysRelExpr.cpp           |   6 +-
 core/sql/optimizer/PhyProp.cpp                  |   8 +-
 core/sql/optimizer/memo.cpp                     |   8 +-
 core/sql/parser/ElemDDLNode.cpp                 |   2 +-
 core/sql/qms/QmsMVMemo.cpp                      |   2 +-
 core/sql/runtimestats/ssmpipc.cpp               |   2 +-
 win-odbc64/odbcclient/drvr35/charsetconv.cpp    |  84 +-
 21 files changed, 1023 insertions(+), 85 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/b32351ff/core/conn/jdbc_type2/native/SqlInterface.cpp
----------------------------------------------------------------------
diff --git a/core/conn/jdbc_type2/native/SqlInterface.cpp 
b/core/conn/jdbc_type2/native/SqlInterface.cpp
index 48a397b..1076fb3 100644
--- a/core/conn/jdbc_type2/native/SqlInterface.cpp
+++ b/core/conn/jdbc_type2/native/SqlInterface.cpp
@@ -67,11 +67,13 @@ extern int SPJRS;
 }\
 }
 
-#define THREAD_RETURN(pSrvrStmt, return_code) \
-{ \
-       pSrvrStmt->threadReturnCode = return_code; \
-       if (pSrvrStmt->threadReturnCode!=SQL_SUCCESS) 
pSrvrStmt->processThreadReturnCode(); \
-       CLI_DEBUG_RETURN_SQL(pSrvrStmt->threadReturnCode); \
+#define THREAD_RETURN(pSrvrStmt, return_code)                           \
+{                                                                       \
+    if (NULL != pSrvrStmt)                                              \
+        pSrvrStmt->threadReturnCode = return_code;                      \
+    if (NULL != pSrvrStmt && pSrvrStmt->threadReturnCode!=SQL_SUCCESS)  \
+        pSrvrStmt->processThreadReturnCode();                           \
+    CLI_DEBUG_RETURN_SQL(return_code);                                  \
 }
 
 #define HANDLE_THREAD_ERROR(error_code, warning_flag, pSrvrStmt) \

http://git-wip-us.apache.org/repos/asf/trafodion/blob/b32351ff/core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp
----------------------------------------------------------------------
diff --git a/core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp 
b/core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp
index a0aaf26..e4a7b35 100644
--- a/core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp
+++ b/core/conn/odbc/src/odbc/nsksrvr/SrvrConnect.cpp
@@ -1163,10 +1163,12 @@ ImplInit (
                srvrGlobal = new SRVR_GLOBAL_Def;
                if (srvrGlobal == NULL)
                {
+                       IDL_OBJECT_def objRef;
+                       memset(&objRef, 0, sizeof(IDL_OBJECT_def));
 //LCOV_EXCL_START
                        SendEventMsg(MSG_MEMORY_ALLOCATION_ERROR, 
EVENTLOG_ERROR_TYPE,
-                                       srvrGlobal->nskProcessInfo.processId, 
ODBCMX_SERVER,
-                                       srvrGlobal->srvrObjRef, 1, 
"srvrGlobal");
+                                       GetCurrentProcessId(), ODBCMX_SERVER,
+                                       objRef, 1, "srvrGlobal");
                        exitServerProcess();
 //LCOV_EXCL_STOP
                }

http://git-wip-us.apache.org/repos/asf/trafodion/blob/b32351ff/core/conn/trafci/Makefile.bak
----------------------------------------------------------------------
diff --git a/core/conn/trafci/Makefile.bak b/core/conn/trafci/Makefile.bak
new file mode 100644
index 0000000..bc0b26f
--- /dev/null
+++ b/core/conn/trafci/Makefile.bak
@@ -0,0 +1,41 @@
+# @@@ 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 @@@
+
+# This Makefile is just a thin shell to Maven, which is used to do the real 
build
+
+include ../../macros.gmk #top level
+
+all:Trafci_deploy
+Trafci_deploy:Trafci_installer
+Trafci_installer:Trafci_jar
+Trafci_jar:
+       mvn clean install -DskipTests$
+Trafci_installer:
+       ./getBuildInfo
+       export buildId=`head -n 1 buildId`
+       mvn -f installer_pom.xml -DbldId=${buildId} clean package -DskipTests
+Trafci_deploy:
+       zip -r ../clients/trafci.zip -j target/trafciInstaller.jar utils/README
+       java -jar target/trafciInstaller.jar -silent -installDir ${TRAF_HOME}
+
+clean:
+       mvn -f installer_pom.xml clean
+       mvn -f pom.xml clean

Reply via email to