You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by se...@apache.org on 2017/10/15 22:07:23 UTC

[4/9] incubator-trafodion git commit: [TRAFODION-2768] Make Trafodion code base to compile in RH7

[TRAFODION-2768] Make Trafodion code base to compile in RH7


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

Branch: refs/heads/master
Commit: ec9ec1711b5ac977d89196e477ff1fb21db8a2ba
Parents: 6439dea
Author: selvaganesang <se...@esgyn.com>
Authored: Mon Oct 9 23:37:51 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Mon Oct 9 23:37:51 2017 +0000

----------------------------------------------------------------------
 core/sql/cli/Cli.cpp                            |  22 +-
 core/sql/cli/Cli.h                              |   2 +-
 core/sql/cli/CliExtern.cpp                      | 236 +++++++++----------
 core/sql/cli/Context.cpp                        |   7 +-
 core/sql/cli/Descriptor.cpp                     |   2 +-
 core/sql/cli/Statement.cpp                      |   8 +-
 core/sql/cli/Statement.h                        |   3 +-
 core/sql/comexe/CmpMessage.cpp                  |   6 +-
 core/sql/comexe/ComTdbRoot.cpp                  |   2 +-
 core/sql/comexe/ComTdbSendTop.cpp               |   2 +-
 core/sql/comexe/ComTdbStoredProc.cpp            |   2 +-
 core/sql/comexe/ComTdbUdr.cpp                   |   4 +-
 core/sql/comexe/ExplainTuple.cpp                |   2 +-
 core/sql/comexe/FragDir.cpp                     |   2 +-
 core/sql/comexe/LateBindInfo.cpp                |   2 +-
 core/sql/comexe/PartInputDataDesc.cpp           |   2 +-
 core/sql/common/BloomFilter.cpp                 |   2 +-
 core/sql/common/Collections.cpp                 |  19 +-
 core/sql/common/Collections.h                   |  13 +-
 core/sql/common/ComUser.cpp                     |   1 -
 core/sql/common/DateTimeType.cpp                |   5 +-
 core/sql/common/Ipc.cpp                         |   2 +-
 core/sql/common/SharedPtr.h                     |   8 +-
 core/sql/common/ipcmsg.h                        |   2 +-
 core/sql/common/swscanf.cpp                     |   2 +-
 core/sql/executor/BufferReference.cpp           |   4 +-
 core/sql/executor/ExExeUtil.h                   |   2 +-
 core/sql/executor/ExExeUtilCommon.cpp           |   2 +-
 core/sql/executor/ExExeUtilGet.cpp              |   2 +-
 core/sql/executor/ExExeUtilLoad.cpp             |  20 +-
 core/sql/executor/ExExeUtilMisc.cpp             |   4 +-
 core/sql/executor/ExExplain.cpp                 |   2 +-
 core/sql/executor/ExFastTransport.cpp           |   4 +-
 core/sql/executor/ExFastTransport.h             |   2 +-
 core/sql/executor/ExHbaseAccess.cpp             |   4 +-
 core/sql/executor/ExHdfsScan.cpp                |   4 +-
 core/sql/executor/ExHdfsScan.h                  |   2 +-
 core/sql/executor/ExSMEvent.cpp                 |   4 +-
 core/sql/executor/ExSMTaskList.cpp              |   2 +-
 core/sql/executor/ExStats.cpp                   |   2 +-
 core/sql/executor/ExUdrServer.cpp               |   2 +-
 core/sql/executor/HBaseClient_JNI.cpp           |   6 +-
 core/sql/executor/cluster.cpp                   |   2 +-
 core/sql/executor/ex_globals.cpp                |   9 +-
 core/sql/executor/ex_globals.h                  |   6 +-
 core/sql/executor/hash_table.cpp                |   4 +-
 core/sql/executor/hiveHook.cpp                  |   4 +-
 core/sql/exp/ExpAtp.cpp                         |   2 +-
 core/sql/exp/ExpConvMxcs.cpp                    |   2 +-
 core/sql/exp/ExpCriDesc.cpp                     |   2 +-
 core/sql/exp/ExpHbaseInterface.cpp              |   6 +-
 core/sql/exp/ExpLOB.cpp                         |  28 +--
 core/sql/exp/ExpLOB.h                           |  21 +-
 core/sql/exp/ExpLOBaccess.cpp                   |   6 +-
 core/sql/exp/ExpLOBaccess.h                     |   2 +-
 core/sql/exp/ExpLOBinterface.cpp                |  43 ++--
 core/sql/exp/ExpLOBinterface.h                  |  40 ++--
 core/sql/exp/ExpPCode.cpp                       |   2 +-
 core/sql/exp/ExpPCodeOptimizations.cpp          |   2 +-
 core/sql/exp/ExpPCodeOptimizations.h            |   2 +-
 core/sql/exp/ExpPCodeOptsNativeExpr.cpp         |   4 +-
 core/sql/exp/ExpPackDefs.cpp                    |   2 +-
 core/sql/exp/exp_bignum.cpp                     |   2 +-
 core/sql/exp/exp_clause.cpp                     |   2 +-
 core/sql/exp/exp_conv.cpp                       |  20 +-
 core/sql/exp/exp_eval.cpp                       |   8 +-
 core/sql/exp/exp_function.cpp                   |  16 +-
 core/sql/export/NAVersionedObject.h             |  12 +-
 core/sql/generator/GenExpGenerator.cpp          |   2 +-
 core/sql/langman/LmResultSetJava.cpp            |   2 +-
 core/sql/nskgmake/Makerules.linux               |   1 +
 core/sql/optimizer/BindItemExpr.cpp             |   8 +-
 core/sql/optimizer/BindRelExpr.cpp              |   4 +-
 core/sql/optimizer/CompilerTracking.cpp         |   4 +-
 core/sql/optimizer/EstLogProp.h                 |   1 +
 core/sql/optimizer/HDFSHook.h                   |   1 +
 core/sql/optimizer/ItemExpr.cpp                 |   2 +-
 core/sql/optimizer/NATable.cpp                  |   5 +-
 core/sql/optimizer/OptLogRelExpr.cpp            |   6 +-
 core/sql/optimizer/OptRange.cpp                 |   2 +-
 core/sql/optimizer/OptimizerSimulator.cpp       |  12 +-
 core/sql/optimizer/SynthType.cpp                |   3 +-
 core/sql/optimizer/UdfDllInteraction.cpp        |   4 +-
 core/sql/parser/SqlParserAux.cpp                |   2 +-
 core/sql/parser/StmtDDLCreate.cpp               |   4 +-
 core/sql/parser/sqlparser.y                     | 100 ++++----
 core/sql/sort/Qsort.cpp                         |   4 +-
 core/sql/sort/RunDirectory.cpp                  |   4 +-
 core/sql/sort/ScratchFileConnection.h           |   2 +-
 core/sql/sort/ScratchFileMap.cpp                |   8 +-
 core/sql/sort/ScratchSpace.cpp                  | 106 ++++-----
 core/sql/sort/SortUtil.cpp                      |  32 +--
 core/sql/sort/SortUtilCfg.cpp                   |   2 +-
 core/sql/sort/TreeNode.cpp                      |   4 +-
 core/sql/sort/diskpool_sq.cpp                   |   4 +-
 core/sql/sort/scratchfile_base.cpp              |   4 +-
 core/sql/sqlcomp/CmpDescribe.cpp                |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp          |   9 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.h            |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp       |   5 +-
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp        |  32 +--
 core/sql/sqlcomp/CmpSeabaseDDLindex.cpp         |  16 +-
 core/sql/sqlcomp/CmpSeabaseDDLmd.h              | 155 ++++++------
 core/sql/sqlcomp/CmpSeabaseDDLrepos.cpp         |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLrepos.h           |  48 ++--
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp       |  10 +-
 core/sql/sqlcomp/CmpSeabaseDDLroutine.h         |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp        |  24 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp         |  74 +++---
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp       |   4 +-
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.h         |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp          |   4 +-
 core/sql/sqlcomp/PrivMgr.cpp                    |   2 +-
 core/sql/sqlcomp/PrivMgrCommands.cpp            |   2 +-
 core/sql/sqlcomp/PrivMgrCommands.h              |   2 +-
 core/sql/sqlcomp/PrivMgrComponentOperations.cpp |   6 +-
 core/sql/sqlcomp/PrivMgrComponentPrivileges.cpp |   6 +-
 core/sql/sqlcomp/PrivMgrMD.cpp                  |  18 +-
 core/sql/sqlcomp/PrivMgrMDTable.cpp             |  10 +-
 core/sql/sqlcomp/PrivMgrObjects.cpp             |   2 +-
 core/sql/sqlcomp/PrivMgrPrivileges.cpp          |  14 +-
 core/sql/sqlcomp/PrivMgrRoles.cpp               |   2 +-
 core/sql/sqlcomp/QCache.cpp                     |   5 +-
 core/sql/sqlcomp/nadefaults.cpp                 |   2 +-
 core/sql/ustat/hs_globals.cpp                   |  12 +-
 core/sql/ustat/hs_read.cpp                      |   6 +-
 core/sql/ustat/hs_util.cpp                      |   2 +-
 127 files changed, 744 insertions(+), 746 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index b128ed6..c2010d1 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -1641,9 +1641,9 @@ Lng32 SQLCLI_SetRowsetDescPointers(CliGlobals * cliGlobals,
             ind_ptr    = va_arg(ap, char *);
           }
           else {
-            var_layout = (char *)quad_fields[i].var_layout;
+            var_layout = (char *)((long)quad_fields[i].var_layout);
             var_ptr = (char *)quad_fields[i].var_ptr;
-            ind_layout = (char *)quad_fields[i].ind_layout;
+            ind_layout = (char *)((long)quad_fields[i].ind_layout);
             ind_ptr = quad_fields[i].ind_ptr == (void *)-1 ? 0 : (char *)quad_fields[i].ind_ptr;
           }
           // setDescItems requires setting the rowset size and layout size items
@@ -8566,7 +8566,7 @@ Lng32 SQLCLI_LOBcliInterface
 	Int64 descSyskey = 0;
 	Lng32 len = 0;
 	cliRC = cliInterface->executeImmediate(query,
-					       (char*)&descSyskey, &len, NULL);
+					       (char*)&descSyskey, &len, FALSE);
 
 	currContext.resetSqlParserFlags(0x1);
 
@@ -9248,7 +9248,7 @@ Lng32 SQLCLI_LOBcliInterface
 Lng32 SQLCLI_LOB_GC_Interface
 (
      /*IN*/     CliGlobals *cliGlobals,
-     /*IN*/     void *lobGlobals, // can be passed or NULL
+     /*IN*/     ExLobGlobals *lobGlobals, // can be passed or NULL
      /*IN*/     char * handle,
      /*IN*/     Lng32  handleLen,
      /*IN*/     char*  hdfsServer,
@@ -9465,7 +9465,7 @@ Lng32 SQLCLI_LOB_GC_Interface
   // Compact into new temp file
        
         
-  rc = ExpLOBoper::compactLobDataFile(lobGlobals,dcInMemoryArray,numEntries,tgtLobName,lobMaxMemChunkLen, (void *)currContext.exHeap(), (void *)&currContext,hdfsServer, hdfsPort,lobLocation);
+  rc = ExpLOBoper::compactLobDataFile(lobGlobals,dcInMemoryArray,numEntries,tgtLobName,lobMaxMemChunkLen, currContext.exHeap(), &currContext,hdfsServer, hdfsPort,lobLocation);
                
   if (rc )
     {
@@ -9483,7 +9483,7 @@ Lng32 SQLCLI_LOB_GC_Interface
       // For now, return error for the IUD operation
 
       // Restore original data file.
-      Int32 rc2=ExpLOBoper::restoreLobDataFile(lobGlobals,tgtLobName, (void *)currContext.exHeap(),(void *)&currContext,hdfsServer,hdfsPort,lobLocation);
+      Int32 rc2=ExpLOBoper::restoreLobDataFile(lobGlobals,tgtLobName, currContext.exHeap(),&currContext,hdfsServer,hdfsPort,lobLocation);
       if (rc2)
         {
           lobDebugInfo("restoreLobDataFile Failed",0,__LINE__,lobTrace);
@@ -9494,7 +9494,7 @@ Lng32 SQLCLI_LOB_GC_Interface
   else
     {
       //TBD :commit all updates and remove the saved copy of datafile
-      ExpLOBoper::purgeBackupLobDataFile(lobGlobals, tgtLobName,(void *)currContext.exHeap(),(void *)&currContext,hdfsServer,hdfsPort,lobLocation);
+      ExpLOBoper::purgeBackupLobDataFile(lobGlobals, tgtLobName,currContext.exHeap(),&currContext,hdfsServer,hdfsPort,lobLocation);
       lobDebugInfo("purgedLobDataFile ",0,__LINE__,lobTrace);
     }
   }
@@ -9611,7 +9611,7 @@ Lng32 SQLCLI_LOBddlInterface
 	  {
 	    // create lob data tables
 	    Lng32 rc = ExpLOBoper::createLOB
-	      (NULL, (void *)&currContext,currContext.exHeap(),
+	      (NULL, &currContext,currContext.exHeap(),
 	       lobLocList[i],  hdfsPort,hdfsServer,
 	       objectUID, lobNumList[i],lobMaxSize);
 	    
@@ -9686,7 +9686,7 @@ Lng32 SQLCLI_LOBddlInterface
 	for (Lng32 i = 0; i < numLOBs; i++)
 	  {
 	    Lng32 rc = ExpLOBoper::dropLOB
-	      (NULL, currContext.exHeap(),(void *)&currContext,
+	      (NULL, currContext.exHeap(),&currContext,
 	       lobLocList[i],hdfsPort,hdfsServer,
 	       objectUID, lobNumList[i]);
 	    
@@ -9759,7 +9759,7 @@ Lng32 SQLCLI_LOBddlInterface
 	for (Lng32 i = 0; i < numLOBs; i++)
 	  {
 	    Lng32 rc = ExpLOBoper::dropLOB
-	      (NULL, currContext.exHeap(),(void *)&currContext,
+	      (NULL, currContext.exHeap(),&currContext,
 	       lobLocList[i],hdfsPort, hdfsServer,
 	       objectUID, lobNumList[i]);
 	    
@@ -10331,7 +10331,7 @@ static Lng32 SeqGenCliInterfacePrepQry(
 
       cliRC = cliInterface->executeImmediatePrepare(query, 
 						    NULL, 0, 
-						    &rowsAffected, NULL,
+						    &rowsAffected, FALSE,
 						    stmtName);
       if (cliRC < 0)
 	{

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Cli.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.h b/core/sql/cli/Cli.h
index 35cee3c..bc8ae16 100644
--- a/core/sql/cli/Cli.h
+++ b/core/sql/cli/Cli.h
@@ -904,7 +904,7 @@ Lng32 SQLCLI_LOBcliInterface
 Lng32 SQLCLI_LOB_GC_Interface
 (
  /*IN*/     CliGlobals *cliGlobals,
- /*IN*/     void *lobGlobals, // can be passed or NULL
+ /*IN*/     ExLobGlobals *lobGlobals, // can be passed or NULL
  /*IN*/     char * handle,
  /*IN*/     Lng32  handleLen,
  /*IN*/     char*  hdfsServer,

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/CliExtern.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/CliExtern.cpp b/core/sql/cli/CliExtern.cpp
index f4724c6..d7454f9 100644
--- a/core/sql/cli/CliExtern.cpp
+++ b/core/sql/cli/CliExtern.cpp
@@ -937,7 +937,7 @@ Lng32 SQL_EXEC_AllocDesc(/*INOUT*/       SQLDESC_ID * desc_id,
                         /*IN OPTIONAL*/ SQLDESC_ID * input_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -985,7 +985,7 @@ Lng32 SQL_EXEC_AllocDescBasic(/*INOUT*/       SQLDESC_ID * desc_id,
                              /*IN OPTIONAL*/       Lng32   max_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1022,7 +1022,7 @@ Lng32 SQL_EXEC_AllocStmt(/*INOUT*/       SQLSTMT_ID * new_statement_id,
                         /*IN OPTIONAL*/ SQLSTMT_ID * cloned_statement)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1073,7 +1073,7 @@ Lng32 SQL_EXEC_AllocStmtForRS(/*IN*/ SQLSTMT_ID *callStmtId,
                              /*INOUT*/ SQLSTMT_ID *resultSetStmtId)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1120,7 +1120,7 @@ Lng32 SQL_EXEC_AssocFileNumber(/*IN*/ SQLSTMT_ID * statement_id,
 			      /*IN*/ short        file_number)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1161,7 +1161,7 @@ Lng32 SQL_EXEC_ASSOCFILENUMBER (/*IN*/ SQLSTMT_ID * statement_id,
 Lng32 SQL_EXEC_ClearDiagnostics(/*IN*/ SQLSTMT_ID *statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1209,7 +1209,7 @@ Lng32 SQL_EXEC_CLI_VERSION()
 Lng32 SQL_EXEC_CloseStmt(/*IN*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1354,7 +1354,7 @@ Lng32 SQL_EXEC_DELETECONTEXT(/*IN*/ SQLCTX_HANDLE contextHandle){
 Lng32 SQL_EXEC_DropModule(/*IN*/ SQLMODULE_ID * module_name)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
       
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1422,7 +1422,7 @@ Lng32 SQL_EXEC_RESETCONTEXT(/*IN*/ SQLCTX_HANDLE contextHandle, /*IN*/ void *con
 Lng32 SQL_EXEC_GetUdrErrorFlags_Internal(/*OUT*/ Lng32 *udrErrorFlags)
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
   CLI_NONPRIV_PROLOGUE(retcode);
@@ -1457,7 +1457,7 @@ Lng32 SQL_EXEC_SetUdrAttributes_Internal(/*IN*/ Lng32 sqlAccessMode,
 					/*IN*/ Lng32 forFutureUse)
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
   CLI_NONPRIV_PROLOGUE(retcode);
@@ -1494,7 +1494,7 @@ Lng32 SQL_EXEC_SetUdrAttributes_Internal(/*IN*/ Lng32 sqlAccessMode,
 Lng32 SQL_EXEC_ResetUdrErrorFlags_Internal()
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
   CLI_NONPRIV_PROLOGUE(retcode);
@@ -1532,7 +1532,7 @@ Lng32 SQL_EXEC_SetUdrRuntimeOptions_Internal(/*IN*/ const char *options,
                                             /*IN*/ ULng32 delimsLen)
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
   CLI_NONPRIV_PROLOGUE(retcode);
@@ -1569,7 +1569,7 @@ Lng32 SQL_EXEC_SetUdrRuntimeOptions_Internal(/*IN*/ const char *options,
 Lng32 SQL_EXEC_DeallocDesc(/*IN*/ SQLDESC_ID * desc_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1603,7 +1603,7 @@ Lng32 SQL_EXEC_DEALLOCDESC (
 Lng32 SQL_EXEC_DeallocStmt(/*IN*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1655,7 +1655,7 @@ Lng32 SQL_EXEC_DefineDesc(/*IN*/ SQLSTMT_ID * statement_id,
                          /*IN*/ SQLDESC_ID * sql_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1698,7 +1698,7 @@ Lng32 SQL_EXEC_DescribeStmt(/*IN*/          SQLSTMT_ID * statement_id,
                            /*IN OPTIONAL*/ SQLDESC_ID * output_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1750,7 +1750,7 @@ Lng32 SQL_EXEC_DESCRIBESTMT (
 Lng32 SQL_EXEC_DisassocFileNumber(/*IN*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1825,7 +1825,7 @@ Lng32 SQL_EXEC_Exec(/*IN*/          SQLSTMT_ID * statement_id,
                                                 ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1882,7 +1882,7 @@ Lng32 SQL_EXEC_EXEC (
 		/*IN*/ SQLCLI_PTR_PAIRS ptr_pairs[])
  {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -1924,7 +1924,7 @@ Lng32 SQL_EXEC_ExecClose(/*IN*/          SQLSTMT_ID * statement_id,
                                                      ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -1973,7 +1973,7 @@ Lng32 SQL_EXEC_EXECCLOSE (
 		/*IN*/ Lng32 num_ptr_pairs,
 		/*IN*/ SQLCLI_PTR_PAIRS ptr_pairs[]) {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2018,7 +2018,7 @@ Lng32 SQL_EXEC_ExecDirect(/*IN*/          SQLSTMT_ID * statement_id,
                                                       ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2068,7 +2068,7 @@ Lng32 SQL_EXEC_ExecDirect2(/*IN*/          SQLSTMT_ID * statement_id,
                                                       ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2118,7 +2118,7 @@ Lng32 SQL_EXEC_EXECDIRECT (
 		/*IN*/ Lng32 num_ptr_pairs,
 		/*IN*/ SQLCLI_PTR_PAIRS ptr_pairs[]) {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2162,7 +2162,7 @@ Lng32 SQL_EXEC_ExecDirectDealloc(/*IN*/          SQLSTMT_ID * statement_id,
                                                       ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2211,7 +2211,7 @@ Lng32 SQL_EXEC_EXECDIRECTDEALLOC(/*IN*/          SQLSTMT_ID * statement_id,
                                 /*IN*/    SQLCLI_PTR_PAIRS   ptr_pairs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2256,7 +2256,7 @@ Lng32 SQL_EXEC_ExecFetch(/*IN*/          SQLSTMT_ID * statement_id,
                                                      ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2311,7 +2311,7 @@ Lng32 SQL_EXEC_EXECFETCH(/*IN*/          SQLSTMT_ID * statement_id,
                         /*IN*/    SQLCLI_PTR_PAIRS   ptr_pairs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2356,7 +2356,7 @@ Lng32 SQL_EXEC_ClearExecFetchClose(/*IN*/          SQLSTMT_ID * statement_id,
 				  ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2419,7 +2419,7 @@ Lng32 SQL_EXEC_CLEAREXECFETCHCLOSE(/*IN*/ SQLSTMT_ID * statement_id,
 				  /*IN*/ SQLCLI_PTR_PAIRS   output_ptr_pairs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2466,7 +2466,7 @@ Lng32 SQL_EXEC_Fetch(/*IN*/          SQLSTMT_ID * statement_id,
                                                  ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2520,7 +2520,7 @@ Lng32 SQL_EXEC_FETCH(/*IN*/          SQLSTMT_ID * statement_id,
                     /*IN*/    SQLCLI_PTR_PAIRS   ptr_pairs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2565,7 +2565,7 @@ Lng32 SQL_EXEC_FetchClose(/*IN*/          SQLSTMT_ID * statement_id,
                                                       ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2611,7 +2611,7 @@ Lng32 SQL_EXEC_FETCHCLOSE(/*IN*/          SQLSTMT_ID * statement_id,
                          /*IN*/    SQLCLI_PTR_PAIRS   ptr_pairs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2657,7 +2657,7 @@ Lng32 SQL_EXEC_FetchMultiple(/*IN*/           SQLSTMT_ID * statement_id,
                                                       ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2709,7 +2709,7 @@ Lng32 SQL_EXEC_FETCHMULTIPLE(/*IN*/           SQLSTMT_ID * statement_id,
                             /*IN*/   SQLCLI_QUAD_FIELDS   quad_fields[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2756,7 +2756,7 @@ Lng32 SQL_EXEC_FETCHMULTIPLE(/*IN*/           SQLSTMT_ID * statement_id,
 Lng32 SQL_EXEC_Cancel(/*IN OPTIONAL*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2793,7 +2793,7 @@ Lng32 SQL_EXEC_GetDescEntryCount(/*IN*/ SQLDESC_ID * sql_descriptor,
                                 /*IN*/ SQLDESC_ID * output_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2836,7 +2836,7 @@ Lng32 SQL_EXEC_GetDescEntryCountBasic(/*IN*/  SQLDESC_ID * sql_descriptor,
                                      /*OUT*/       Lng32 * num_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -2877,7 +2877,7 @@ Lng32 SQL_EXEC_GetDescItem(/*IN*/     SQLDESC_ID * sql_descriptor,
                           /*IN OPTIONAL*/  Lng32   start_from_offset)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2942,7 +2942,7 @@ Lng32 SQL_EXEC_GetDescItems(/*IN*/   SQLDESC_ID * sql_descriptor,
                            /*IN*/   SQLDESC_ID * output_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -2992,7 +2992,7 @@ Lng32 SQL_EXEC_GetDescItems2(/*IN*/   SQLDESC_ID * sql_descriptor,
 			    /*IN*/ SQLDESC_ITEM   desc_items[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -3036,7 +3036,7 @@ Lng32 SQL_EXEC_GetDiagnosticsStmtInfo(/*IN*/       Lng32 * stmt_info_items,
                                      /*IN*/ SQLDESC_ID * output_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -3078,7 +3078,7 @@ Lng32 SQL_EXEC_GetDiagnosticsStmtInfo2(
      /*OUT OPTIONAL*/ Lng32 * len_of_item)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -3189,7 +3189,7 @@ static Lng32 GetAutoSizedCondInfo(Lng32                   * retcode,
 
   // Can't this be refactored to a simple if-statment, rather than a loop? -KBC
  
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   while (*retcode == 0 && resize)
     {
@@ -3268,7 +3268,7 @@ Lng32 SQL_EXEC_GetDiagnosticsCondInfo(
                 /*IN*/             SQLDESC_ID * output_descriptor)
 {
   Lng32 retcode = 0;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
 
   
@@ -3528,7 +3528,7 @@ Lng32 SQL_EXEC_GetDiagnosticsCondInfo2(
      /*OUT OPTIONAL*/ Lng32 * len_of_item)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    
@@ -3671,7 +3671,7 @@ Lng32 SQL_EXEC_GetDiagnosticsCondInfo3(
   NAWchar* p = NULL;
   NABoolean msgInLocaleLenIsAvailable = FALSE;
   Lng32 msgInLocaleLen = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -3712,7 +3712,7 @@ Lng32 SQL_EXEC_GetDiagnosticsCondInfo3(
      message_obj_size = message_obj_size_needed;
 
      SQLMXLoggingArea::ExperienceLevel emsEventEL = SQLMXLoggingArea::eAdvancedEL;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
      try
@@ -4014,7 +4014,7 @@ Lng32 SQL_EXEC_GETCOBOLSQLSTATE(
 Lng32 SQL_EXEC_GetSQLSTATE(/*OUT*/ char * SQLSTATE /* assumed to be char[6] */)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    Lng32 sqlcode;
 
@@ -4063,7 +4063,7 @@ Lng32 SQL_EXEC_GetSessionAttr(
 			  /*OUT OPTIONAL*/      Lng32 * len_of_item)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4106,7 +4106,7 @@ Lng32 SQL_EXEC_GetAuthID(
 {
 
 Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4149,7 +4149,7 @@ Lng32 SQL_EXEC_GetAuthName_Internal(
 {
 
 Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4191,7 +4191,7 @@ Lng32 SQL_EXEC_GetDatabaseUserName_Internal (
     /*OUT OPTIONAL*/  Lng32  *len_of_item)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4230,7 +4230,7 @@ Lng32 SQL_EXEC_GetDatabaseUserID_Internal (/*IN*/   char   *string_value,
                                            /*OUT*/  Lng32  *numeric_value)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4272,7 +4272,7 @@ Int32 SQL_EXEC_GetAuthState(
 {
 
    Int32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4314,7 +4314,7 @@ Lng32 SQL_EXEC_SetSessionAttr_Internal(
     /*IN OPTIONAL*/            char  *string_value)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4356,7 +4356,7 @@ Lng32 SQL_EXEC_GetRoleList(
 {
 
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4393,7 +4393,7 @@ Lng32 SQL_EXEC_GetRoleList(
 Lng32 SQL_EXEC_ResetRoleList_Internal()
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4433,7 +4433,7 @@ Lng32 SQL_EXEC_GetUniqueQueryIdAttrs(
 		/*INOUT*/ UNIQUEQUERYID_ATTR unique_queryid_attrs[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
 
@@ -4475,7 +4475,7 @@ Lng32 SQL_EXEC_GetStmtAttr(/*IN*/ SQLSTMT_ID * statement_id,
 			  /*OUT OPTIONAL*/      Lng32 * len_of_item)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
 
@@ -4527,7 +4527,7 @@ Lng32 SQL_EXEC_GetStmtAttrs(/*IN*/ SQLSTMT_ID * statement_id,
                            /*OUT OPTIONAL*/ Lng32 * num_returned)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
 
@@ -4592,7 +4592,7 @@ Lng32 SQL_EXEC_Prepare(/*IN*/ SQLSTMT_ID * statement_id,
                       /*IN*/ SQLDESC_ID * sql_source)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4638,7 +4638,7 @@ Lng32 SQL_EXEC_Prepare2(/*IN*/ SQLSTMT_ID * statement_id,
 		       /*IN*/ ULng32 flags)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4703,7 +4703,7 @@ Int32 SQL_EXEC_GetExplainData(
                                               /*INOUT*/ Int32 * ret_explain_len)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4747,7 +4747,7 @@ Int32 SQL_EXEC_StoreExplainData(
                                                 /*IN*/    Int32 explain_len)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4789,7 +4789,7 @@ Lng32 SQL_EXEC_ResDescName(/*INOUT*/       SQLDESC_ID * statement_id,
          /* (SQLWHAT_DESC) *IN OPTIONAL*/       Lng32   what_desc)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4834,7 +4834,7 @@ Lng32 SQL_EXEC_RESDESCNAME(
 Lng32 SQL_EXEC_ResStmtName(/*INOUT*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4876,7 +4876,7 @@ Lng32 SQL_EXEC_SetCursorName(/*IN*/ SQLSTMT_ID * statement_id,
                             /*IN*/ SQLSTMT_ID * cursor_name)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4921,7 +4921,7 @@ Lng32 SQL_EXEC_SetStmtAttr(/*IN*/ SQLSTMT_ID * statement_id,
                           /*IN OPTIONAL*/       char * string_value)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -4971,7 +4971,7 @@ Lng32 SQL_EXEC_SetDescEntryCount(/*IN*/ SQLDESC_ID * sql_descriptor,
                                 /*IN*/ SQLDESC_ID * input_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5015,7 +5015,7 @@ Lng32 SQL_EXEC_SetDescEntryCountBasic(/*IN*/ SQLDESC_ID * sql_descriptor,
                                      /*IN*/       Lng32   num_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5055,7 +5055,7 @@ Lng32 SQL_EXEC_SetDescItem(/*IN*/          SQLDESC_ID * sql_descriptor,
                           /*IN OPTIONAL*/       char * string_value)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5105,7 +5105,7 @@ Lng32 SQL_EXEC_SetDescItems(/*IN*/   SQLDESC_ID * sql_descriptor,
                            /*IN*/   SQLDESC_ID * input_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5156,7 +5156,7 @@ Lng32 SQL_EXEC_SetDescItems2(
 		/*IN*/ SQLDESC_ITEM desc_items[])
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    try
@@ -5202,7 +5202,7 @@ Lng32 SQL_EXEC_SetDescPointers(/*IN*/ SQLDESC_ID * sql_descriptor,
                               ...)
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5248,7 +5248,7 @@ Lng32 SQL_EXEC_SETDESCPOINTERS(/*IN*/       SQLDESC_ID * sql_descriptor,
                               /*IN*/       SQLCLI_PTR_PAIRS   ptr_pairs[])
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5292,7 +5292,7 @@ Lng32 SQL_EXEC_SetRowsetDescPointers(SQLDESC_ID * sql_descriptor,
                                            ...)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5342,7 +5342,7 @@ Lng32 SQL_EXEC_SETROWSETDESCPOINTERS(SQLDESC_ID * sql_descriptor,
                              SQLCLI_QUAD_FIELDS    quad_fields[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5418,7 +5418,7 @@ Lng32 SQL_EXEC_Xact(/*IN* (SQLTRANS_COMMAND) */       Lng32   command,
                    /*OUT OPTIONAL*/            SQLDESC_ID * transid_descriptor)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5468,7 +5468,7 @@ Lng32 SQL_EXEC_SetAuthID(
 {
 
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5512,7 +5512,7 @@ Lng32 SQL_EXEC_AllocDesc(/*INOUT*/       SQLDESC_ID * desc_id,
                         /*IN OPTIONAL*/       Lng32   max_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5549,7 +5549,7 @@ Lng32 SQL_EXEC_GetDescEntryCount(/*IN*/  SQLDESC_ID * sql_descriptor,
                                 /*OUT*/       Lng32 * num_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5586,7 +5586,7 @@ Lng32 SQL_EXEC_SetDescEntryCount(/*IN*/ SQLDESC_ID * sql_descriptor,
                                 /*IN*/       Lng32   num_entries)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5625,7 +5625,7 @@ Lng32 SQL_EXEC_SetDescEntryCount(/*IN*/ SQLDESC_ID * sql_descriptor,
 Lng32 SQL_EXEC_MergeDiagnostics_Internal (/*INOUT*/ ComDiagsArea & newDiags)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5667,7 +5667,7 @@ Lng32 SQL_EXEC_GetPackedDiagnostics_Internal(
       /*OUT*/            Lng32 * message_obj_version)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5713,7 +5713,7 @@ void SQL_EXEC_SetParserFlagsForExSqlComp_Internal(ULng32 flagbits)
 Lng32 SQL_EXEC_SetParserFlagsForExSqlComp_Internal2(ULng32 flagbits)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5747,7 +5747,7 @@ Lng32 SQL_EXEC_SetParserFlagsForExSqlComp_Internal2(ULng32 flagbits)
 Lng32 SQL_EXEC_AssignParserFlagsForExSqlComp_Internal(ULng32 flagbits)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5781,7 +5781,7 @@ Lng32 SQL_EXEC_AssignParserFlagsForExSqlComp_Internal(ULng32 flagbits)
 Lng32 SQL_EXEC_GetParserFlagsForExSqlComp_Internal(ULng32 &flagbits)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5823,7 +5823,7 @@ void SQL_EXEC_ResetParserFlagsForExSqlComp_Internal(ULng32 flagbits)
 Lng32 SQL_EXEC_ResetParserFlagsForExSqlComp_Internal2(ULng32 flagbits)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5871,7 +5871,7 @@ Lng32 SQL_EXEC_GetCollectStatsType_Internal (
      /*IN*/ SQLSTMT_ID * statement_id)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5903,7 +5903,7 @@ Lng32 SQL_EXEC_SPBreakReceived_Internal (
 Lng32 SQL_EXEC_SetEnviron_Internal(Lng32 propagate)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
   try
@@ -5953,7 +5953,7 @@ Lng32 SQL_EXEC_LocaleToUTF8 (
                /*OUT*/Int32   * num_translated_char)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -5982,7 +5982,7 @@ Lng32 SQL_EXEC_UTF8ToLocale(
                /*IN*/void     * substitution_char_addr)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -6011,7 +6011,7 @@ Lng32 SQL_EXEC_LocaleToUTF16 (
                /*OUT*/Int32   * num_translated_char)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -6042,7 +6042,7 @@ Lng32 SQL_EXEC_UTF16ToLocale(
                /*IN*/void     * substitution_char_addr)
 {
    Lng32 retcode = 0;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -6064,7 +6064,7 @@ Lng32 SQL_EXEC_SetErrorCodeInRTS(
     /*IN*/ Lng32     sqlErrorCode)
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 try 
   {   
@@ -6096,7 +6096,7 @@ Lng32 SQL_EXEC_SetSecInvalidKeys(
            /* IN */    SQL_QIKEY siKeys[])
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
    try
@@ -6135,7 +6135,7 @@ Lng32 SQL_EXEC_GetSecInvalidKeys(
             /* IN/OUT */  Int64 *maxTimestamp)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
    try
@@ -6182,7 +6182,7 @@ Lng32 SQL_EXEC_GetStatistics2(
 	    /* OUT */	Lng32 *no_returned_stats_desc)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
    try
@@ -6228,7 +6228,7 @@ Lng32 SQL_EXEC_GetStatisticsItems(
 	    /* IN/OUT */   SQLSTATS_ITEM sqlstats_items[])
 {
      Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
    try
@@ -6273,7 +6273,7 @@ Lng32 SQL_EXEC_RegisterQuery(SQLQUERY_ID *queryId,
                             Lng32 tdbNameLen)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
 try 
@@ -6308,7 +6308,7 @@ Lng32 SQL_EXEC_DeregisterQuery(SQLQUERY_ID *queryId,
                             Lng32 fragId)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
 try 
@@ -6351,7 +6351,7 @@ Lng32 SQL_EXEC_GetStatisticsArea_Internal
  /*INOUT*/   const ExStatisticsArea* &exStatsArea)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
 
    CLI_NONPRIV_PROLOGUE(retcode);
@@ -6397,7 +6397,7 @@ Lng32 SQL_EXEC_GetChildQueryInfo(
      /*INOUT*/ SQL_QUERY_COMPILER_STATS_INFO *comp_stats_info)
 {
    Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
    CLI_NONPRIV_PROLOGUE(retcode);
    try
@@ -6452,7 +6452,7 @@ Lng32 SQL_EXEC_LOBcliInterface
  )
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6506,7 +6506,7 @@ Lng32 SQL_EXEC_LOB_GC_Interface
  )
 {
   Lng32 retcode;
- CLISemaphore *tmpSemaphore;
+ CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6515,7 +6515,7 @@ Lng32 SQL_EXEC_LOB_GC_Interface
       tmpSemaphore->get();
       threadContext->incrNumOfCliCalls();
       retcode = SQLCLI_LOB_GC_Interface(GetCliGlobals(),
-                                        lobGlobals,
+                                        (ExLobGlobals *)lobGlobals, // Need a way to validate this object
                                         handle,
                                         handleLen,
                                         hdfsServer,
@@ -6558,7 +6558,7 @@ Lng32 SQL_EXEC_LOBddlInterface
  )
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6605,7 +6605,7 @@ Int32 SQL_EXEC_SWITCH_TO_COMPILER_TYPE
 )
 {
   Int32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6640,7 +6640,7 @@ Int32 SQL_EXEC_SWITCH_TO_COMPILER
 )
 {
   Int32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6674,7 +6674,7 @@ Int32 SQL_EXEC_SWITCH_BACK_COMPILER
 )
 {
   Int32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6719,7 +6719,7 @@ Lng32 SQL_EXEC_SEcliInterface
  )
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6763,7 +6763,7 @@ Lng32 SQL_EXEC_SeqGenCliInterface
   )
 {
   Lng32 retcode;
-   CLISemaphore *tmpSemaphore;
+   CLISemaphore *tmpSemaphore = NULL;
    ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6809,7 +6809,7 @@ Lng32 SQL_EXEC_GetRoutine
  )
 {
   Lng32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6867,7 +6867,7 @@ Int32 SQL_EXEC_InvokeRoutine
  )
 {
   Lng32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6922,7 +6922,7 @@ Int32 SQL_EXEC_GetRoutineInvocationInfo
  )
 {
   Lng32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try
@@ -6965,7 +6965,7 @@ Lng32 SQL_EXEC_PutRoutine
  )
 {
   Lng32 retcode;
-  CLISemaphore *tmpSemaphore;
+  CLISemaphore *tmpSemaphore = NULL;
   ContextCli   *threadContext;
   CLI_NONPRIV_PROLOGUE(retcode);
   try

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Context.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Context.cpp b/core/sql/cli/Context.cpp
index ab11551..6eef48f 100644
--- a/core/sql/cli/Context.cpp
+++ b/core/sql/cli/Context.cpp
@@ -4557,7 +4557,7 @@ Int32 ContextCli::switchToCmpContext(Int32 cmpCntxtType)
 
   // find CmpContext_ with the same type to use
   CmpContextInfo *cmpCntxtInfo;
-  CmpContext *cmpCntxt;
+  CmpContext *cmpCntxt = NULL;
   short i;
   for (i = 0; i < cmpContextInfo_.entries(); i++)
     {
@@ -4819,6 +4819,11 @@ void ContextCli::putTrustedRoutine(CollIndex ix)
 // gets cleaned up when the thread exits.
 hdfsFS ContextCli::getHdfsServerConnection(char * hdfs_server, Int32 port)
 {
+  if (hdfs_server == NULL) // guard against NULL and use default value.
+    {
+      hdfs_server = (char *)"default";
+      port = 0;
+    }
   if (hdfsHandleList_)
     {
       // Look for the entry on the list

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Descriptor.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Descriptor.cpp b/core/sql/cli/Descriptor.cpp
index 9b7446b..a1a607f 100644
--- a/core/sql/cli/Descriptor.cpp
+++ b/core/sql/cli/Descriptor.cpp
@@ -1207,7 +1207,7 @@ RETCODE Descriptor::getDescItemMainVarInfo(Lng32 entry,
   if (descItem.var_data)
     {
       *var_ptr        = (void *)descItem.var_data;
-      *ind_ptr        = (void *)descItem.ind_data;
+      *ind_ptr        = (void *)((long)descItem.ind_data);
     }
   else
     {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Statement.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Statement.cpp b/core/sql/cli/Statement.cpp
index 2169373..b537fbb 100644
--- a/core/sql/cli/Statement.cpp
+++ b/core/sql/cli/Statement.cpp
@@ -2020,7 +2020,7 @@ Statement * Statement::getCurrentOfCursorStatement(char * cursorName)
 }
 
 RETCODE Statement::doHiveTableSimCheck(TrafSimilarityTableInfo *si,
-                                       void * lobGlob,
+                                       ExLobGlobals * lobGlob,
                                        NABoolean &simCheckFailed,
                                        ComDiagsArea &diagsArea)
 {
@@ -2093,7 +2093,7 @@ RETCODE Statement::doQuerySimilarityCheck(TrafQuerySimilarityInfo * qsi,
       (qsi->siList()->numEntries() == 0))
     return SUCCESS;
 
-  void * lobGlob = NULL; //getRootTcb()->getGlobals()->getExLobGlobal();
+  ExLobGlobals * lobGlob = NULL; //getRootTcb()->getGlobals()->getExLobGlobal();
   NABoolean lobGlobInitialized = FALSE;
   qsi->siList()->position();
   for (Lng32 i = 0; i < qsi->siList()->numEntries(); i++)
@@ -2973,7 +2973,7 @@ RETCODE Statement::execute(CliGlobals * cliGlobals, Descriptor * input_desc,
                         Descriptor::getCharDataFromCharHostVar
                           (diagsArea,
 			   heap_,
-                           (char *)cursor_name, 
+                           (char *)((long)cursor_name), 
                            string_length,
 			   "CURSOR NAME", 
                            input_desc,
@@ -2988,7 +2988,7 @@ RETCODE Statement::execute(CliGlobals * cliGlobals, Descriptor * input_desc,
 		    if (currentOfCursorStatement_ == NULL)
 		      {
 			diagsArea << DgSqlCode(- CLI_NON_UPDATABLE_SELECT_CURSOR)
-				  << DgString0((char *)cursor_name);
+				  << DgString0((char *)((long)cursor_name));
 			state_ = ERROR_;
 			break;
 		      }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/cli/Statement.h
----------------------------------------------------------------------
diff --git a/core/sql/cli/Statement.h b/core/sql/cli/Statement.h
index 724d3e0..a5dabc4 100644
--- a/core/sql/cli/Statement.h
+++ b/core/sql/cli/Statement.h
@@ -73,6 +73,7 @@ class AQRStatementInfo;
 class StrTarget;
 
 class Statement;
+class ExLobGlobals;
 
 ////////////////////////////////////////////////////////////////////////
 // this class stores statement information that is needed on each cli
@@ -526,7 +527,7 @@ public:
                          const char *prefix, const char *suffix);
  
   RETCODE doHiveTableSimCheck(TrafSimilarityTableInfo *si,
-                              void* lobGlob,
+                              ExLobGlobals* lobGlob,
                               NABoolean &simCheckFailed,
                               ComDiagsArea &diagsArea);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/CmpMessage.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/CmpMessage.cpp b/core/sql/comexe/CmpMessage.cpp
index 7ee112b..af0827b 100644
--- a/core/sql/comexe/CmpMessage.cpp
+++ b/core/sql/comexe/CmpMessage.cpp
@@ -318,14 +318,14 @@ void CmpCompileInfo::packVars(char * buffer, CmpCompileInfo *ci,
   if (sqltext_ && (sqlTextLen_ > 0))
     {
       str_cpy_all(&buffer[nextOffset], sqltext_, sqlTextLen_);
-      ci->sqltext_ = (char *)nextOffset;
+      ci->sqltext_ = (char *)((long)nextOffset);
       nextOffset += ROUND8(sqlTextLen_);
     }
   
   if (schemaName_ && (schemaNameLen_ > 0))
     {
       str_cpy_all(&buffer[nextOffset], (char *)schemaName_, schemaNameLen_);
-      ci->schemaName_ = (char *)nextOffset;
+      ci->schemaName_ = (char *)((long)nextOffset);
       nextOffset += ROUND8(schemaNameLen_);
     }
 }
@@ -466,7 +466,7 @@ void CmpDDLwithStatusInfo::pack(char * buffer)
   if (blackBox_ && (blackBoxLen_ > 0))
     {
       str_cpy_all(&buffer[nextOffset], blackBox_, blackBoxLen_);
-      ci->blackBox_ = (char *)nextOffset;
+      ci->blackBox_ = (char *)((long)nextOffset);
       nextOffset += ROUND8(blackBoxLen_);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/ComTdbRoot.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbRoot.cpp b/core/sql/comexe/ComTdbRoot.cpp
index 6c0d6cf..41e7ce1 100644
--- a/core/sql/comexe/ComTdbRoot.cpp
+++ b/core/sql/comexe/ComTdbRoot.cpp
@@ -270,7 +270,7 @@ void ComTdbRoot::init(ComTdb * child_tdb,
 
 ComTdbRoot::~ComTdbRoot()
 {
-  childTdb = NULL;
+  childTdb = (ComTdbPtr)NULL;
   
   rtFlags1_ = 0;
 };

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/ComTdbSendTop.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSendTop.cpp b/core/sql/comexe/ComTdbSendTop.cpp
index e7bc740..ca10d73 100644
--- a/core/sql/comexe/ComTdbSendTop.cpp
+++ b/core/sql/comexe/ComTdbSendTop.cpp
@@ -134,7 +134,7 @@ const ComTdb * ComTdbSendTop::getChildForGUI(
 {
   ExFragDir * fragDir = (ExFragDir *)frag_dir;
   
-  return (ComTdb *)(base +
+  return (ComTdb *)((long)base +
        fragDir->getGlobalOffset(childFragId_) +
        fragDir->getTopNodeOffset(childFragId_));
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/ComTdbStoredProc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbStoredProc.cpp b/core/sql/comexe/ComTdbStoredProc.cpp
index 16a22a6..78698d8 100644
--- a/core/sql/comexe/ComTdbStoredProc.cpp
+++ b/core/sql/comexe/ComTdbStoredProc.cpp
@@ -134,7 +134,7 @@ ExSPInputOutput::ExSPInputOutput() : NAVersionedObject(-1)
 {
   str_cpy_all(eyeCatcher_, "SPIO", 4);
   totalLen_ = 0;
-  tupleDesc_ = NULL;
+  tupleDesc_ = (ExpTupleDescPtr)NULL;
   caseIndexArray_ = (Int16Ptr) NULL;
   flags_ = 0;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/ComTdbUdr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbUdr.cpp b/core/sql/comexe/ComTdbUdr.cpp
index e3b79f0..ab29c3a 100644
--- a/core/sql/comexe/ComTdbUdr.cpp
+++ b/core/sql/comexe/ComTdbUdr.cpp
@@ -160,7 +160,7 @@ ComTdbUdr::ComTdbUdr(char *sqlName,
     (space->allocateAlignedSpace(numParams_ * sizeof(UdrFormalParamInfoPtr)));
   for (UInt32 i = 0; i < numParams_; i++)
   {
-    paramInfo_[i] = NULL;
+    paramInfo_[i] = (UdrFormalParamInfoPtrPtr)NULL;
   }
 
   //
@@ -170,7 +170,7 @@ ComTdbUdr::ComTdbUdr(char *sqlName,
     (space->allocateAlignedSpace(numChildInputs * sizeof(UdrTableDescInfoPtr)));
   for (UInt32 i = 0; i < numChildInputs; i++)
   {
-    udrChildTableDescInfo_[i] = NULL;
+    udrChildTableDescInfo_[i] = (UdrFormalParamInfoPtrPtr)NULL;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/ExplainTuple.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ExplainTuple.cpp b/core/sql/comexe/ExplainTuple.cpp
index b7f0a06..cf6bf06 100644
--- a/core/sql/comexe/ExplainTuple.cpp
+++ b/core/sql/comexe/ExplainTuple.cpp
@@ -240,7 +240,7 @@ ExplainTupleMaster::init(Space *space, NABoolean doExplainSpaceOpt)
   descCursor_ = 0;
   
   explainTupleStr_ = NULL;
-  explainTupleData_ = NULL;
+  explainTupleData_ = (NABasicPtr)NULL;
 
   // if space opt is to be done, start by allocating max length.
   // this will be trimmed and reset in ExplainTuple::genExplainData at end.

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/FragDir.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/FragDir.cpp b/core/sql/comexe/FragDir.cpp
index 6ee70c3..245a394 100644
--- a/core/sql/comexe/FragDir.cpp
+++ b/core/sql/comexe/FragDir.cpp
@@ -48,7 +48,7 @@ ExFragDir::ExFragDir(Lng32 entries, Space *space,
   : NAVersionedObject(-1)
 {
   numEntries_ = entries;
-  scratchFileOptions_ = NULL;
+  scratchFileOptions_ = (ExScratchFileOptionsPtr)NULL;
   nodeMask_ = 0;
   planVersion_ = ComVersion_GetCurrentPlanVersion();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/LateBindInfo.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/LateBindInfo.cpp b/core/sql/comexe/LateBindInfo.cpp
index b96e320..906fb95 100644
--- a/core/sql/comexe/LateBindInfo.cpp
+++ b/core/sql/comexe/LateBindInfo.cpp
@@ -886,7 +886,7 @@ TrafSimilarityTableInfo::TrafSimilarityTableInfo()
        hdfsRootDir_(NULL),
        modTS_(-1), numPartnLevels_(-1),
        hdfsDirsToCheck_(NULL),
-       hdfsHostName_(NULL), hdfsPort_(NULL),
+       hdfsHostName_(NULL), hdfsPort_(0),
        flags_(0)
 {
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/comexe/PartInputDataDesc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/PartInputDataDesc.cpp b/core/sql/comexe/PartInputDataDesc.cpp
index 367991b..6116392 100644
--- a/core/sql/comexe/PartInputDataDesc.cpp
+++ b/core/sql/comexe/PartInputDataDesc.cpp
@@ -171,7 +171,7 @@ ExRangePartInputData::ExRangePartInputData(
 
 	  // just to be safe, initialize the array with NULLs
 	  for (Lng32 i = 0; i < (numPartitions + 1); i++)
-	    partRangeExpressions_[i] = NULL;
+	    partRangeExpressions_[i] = (ExExprPtrPtr)NULL;
 	}
       else
 	{

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/BloomFilter.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/BloomFilter.cpp b/core/sql/common/BloomFilter.cpp
index 68e3f36..4143b8b 100644
--- a/core/sql/common/BloomFilter.cpp
+++ b/core/sql/common/BloomFilter.cpp
@@ -322,7 +322,7 @@ CountingBloomFilter::CountingBloomFilter(NAHeap* heap) :
   bucketNums_(heap),
   filename_(NULL)
 {
-  paramBuf[0] = NULL;
+  paramBuf[0] = '\0';
 }
 
 void CountingBloomFilter::clear()

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/Collections.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/Collections.cpp b/core/sql/common/Collections.cpp
index 50bbfec..efef0c7 100644
--- a/core/sql/common/Collections.cpp
+++ b/core/sql/common/Collections.cpp
@@ -185,23 +185,8 @@ template <class T> void NACollection<T>::allocate(CollIndex initLen)
 	}
       else
 	{	
-	  // The method for dynamic allocation should match the one in 
-	  // deallocate. When the compiler supports the feature to overload
-	  // new[] and delete[], the following two lines should be used
-	  // instead.
-	  // arr_ = new(heap_) T[maxLength_];
-	  // usages_ = new(heap_) CollIndex[maxLength_];
-	  arr_ = (T *)heap_->allocateMemory(sizeof(T) * ((size_t) maxLength_));
-	  usages_ = (CollIndex *) heap_->allocateMemory(
-               sizeof(CollIndex) * ((size_t) maxLength_));
-
-          // To finish up, we copy uninitialized objects of type T into
-          // the newly-alloc'd space, so vtbl-pointers get set properly.
-          // (This is not always necessary, but it's a good idea in
-          // general!)
-          T temp; 
-          for ( CollIndex i = 0 ; i < maxLength_ ; i++ )
-            memcpy ((void*)&arr_[i], (void*)&temp, sizeof(T)) ;
+	  arr_ = new(heap_) T[maxLength_];
+	  usages_ = new(heap_) CollIndex[maxLength_];
         }
     }
   else

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/Collections.h
----------------------------------------------------------------------
diff --git a/core/sql/common/Collections.h b/core/sql/common/Collections.h
index 3129bfd..a11edb2 100644
--- a/core/sql/common/Collections.h
+++ b/core/sql/common/Collections.h
@@ -442,15 +442,10 @@ public:
     }
     else
     {
-      // user-specified delete operator
-      // Note : this won't call the destructor of each arr_ element. 
-      // after the compiler supports delete[] operator to be supprted,
-      // it should be changed to
-      // if (!arr_) delete [] arr_;
-      // if (!usages_) delete [] usages_;
-
-      if (arr_ != NULL) heap_->deallocateMemory(arr_);
-      if (usages_ != NULL) heap_->deallocateMemory(usages_);
+      if (!arr_) 
+         NADELETE(arr_, T, heap_);
+      if (!usages_) 
+         delete [] usages_;
     }
     arr_ = NULL;
     usages_ = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/ComUser.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComUser.cpp b/core/sql/common/ComUser.cpp
index 95f5a4a..b8261f4 100644
--- a/core/sql/common/ComUser.cpp
+++ b/core/sql/common/ComUser.cpp
@@ -438,4 +438,3 @@ Int32 ComUser::getRoleList (char * roleList,
   roleList[strlen(pRoles)] = 0; // null terminate string
   return FEOK;
 }
-

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/DateTimeType.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/DateTimeType.cpp b/core/sql/common/DateTimeType.cpp
index bef0044..de67e74 100644
--- a/core/sql/common/DateTimeType.cpp
+++ b/core/sql/common/DateTimeType.cpp
@@ -233,13 +233,12 @@ void DatetimeType::datetimeToLong(void *bufPtr,
   char *str = (char *)bufPtr;
   short sw;
   Lng32 size;
-
   Int32 start = getStartField();
   Int32 end = getExtendedEndField(getEndField(), getFractionPrecision());
+  ULng32 val = 0;
 
   for (Int32 i = start; i <= end; i++)
     {
-      ULng32 val;
       size = storageLen[i - 1];
       switch (size) {
       case sizeof(char):
@@ -1850,7 +1849,7 @@ NAString DatetimeValue::getValueAsString(const DatetimeType& dt) const
 
   char cbuf[DatetimeType::MAX_FRACTION_PRECISION + 1];	// +1 for sprintf '\0'
   Int32  clen;
-  ULng32  ulbuf;
+  ULng32  ulbuf = 0;
   unsigned short usbuf;
   unsigned char  ucbuf;
   const unsigned char *value = getValue();

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/Ipc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/Ipc.cpp b/core/sql/common/Ipc.cpp
index 2e3cc42..1b6bd31 100644
--- a/core/sql/common/Ipc.cpp
+++ b/core/sql/common/Ipc.cpp
@@ -2654,7 +2654,7 @@ IpcMessageStream & IpcMessageStream::operator << (IpcMessageObj & toAppend)
       bufObj->setMyVPtr(NULL);
       bufObj->s_.refCount_ = 1;
       bufObj->s_.next_ = NULL;
-      tail_->s_.next_ = (IpcMessageObj *) startOffset;
+      tail_->s_.next_ = (IpcMessageObj *) ((long)startOffset);
       tail_ = bufObj;
     }
   return *this;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/SharedPtr.h
----------------------------------------------------------------------
diff --git a/core/sql/common/SharedPtr.h b/core/sql/common/SharedPtr.h
index eb7b474..338abc6 100644
--- a/core/sql/common/SharedPtr.h
+++ b/core/sql/common/SharedPtr.h
@@ -259,7 +259,7 @@ public:
   }
 
   // Constructor that allows construction with a NULL pointer
-  SharedPtr(const Int32 i) : refCount_(0), objectP_((T*)i) {}
+  SharedPtr(const long i) : refCount_(0), objectP_((T*)i) {}
 
   // Copy constructor
   SharedPtr(SharedPtr<T> const & r) :
@@ -300,7 +300,7 @@ public:
   }
 
   // Allow assignment of pointer to NULL.
-  SharedPtr<T>& operator= (const Int32 i)
+  SharedPtr<T>& operator= (const long i)
   {
     if (refCount_) {
 #ifdef _DEBUG
@@ -390,7 +390,7 @@ public:
   }
 
   // Allow construction with a NULL
-  IntrusiveSharedPtr(const Int32 i) : SharedPtr<T>(i) {} 
+  IntrusiveSharedPtr(const long i) : SharedPtr<T>(i) {} 
 
   // Return a pointer to a shared pointer given an object with an intrusive
   // shared pointer.
@@ -408,7 +408,7 @@ public:
   }
 
   // Provide an assignment operator to prevent the compiler from writing one.
-  IntrusiveSharedPtr<T>& operator= (const Int32 i)
+  IntrusiveSharedPtr<T>& operator= (const long i)
   {
     (void)SharedPtr<T>::operator=(i);
     return *this;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/ipcmsg.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ipcmsg.h b/core/sql/common/ipcmsg.h
index 0b19954..4d4d721 100644
--- a/core/sql/common/ipcmsg.h
+++ b/core/sql/common/ipcmsg.h
@@ -54,7 +54,7 @@ public:
 			const IpcProcessId &procId,
 			NABoolean usesTransactions,
 			unsigned short nowaitDepth,
-                        char *eye = eye_GUA_MSG_CONNECTION_TO_SERVER);
+                        char *eye = (char *)eye_GUA_MSG_CONNECTION_TO_SERVER);
 
   virtual ~GuaMsgConnectionToServer();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/common/swscanf.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/swscanf.cpp b/core/sql/common/swscanf.cpp
index 58a0b56..6883f56 100644
--- a/core/sql/common/swscanf.cpp
+++ b/core/sql/common/swscanf.cpp
@@ -692,7 +692,7 @@ literal:
                //res = (*ccfn)(buf);
 				if (flags & POINTER)
 					*va_arg(ap, void **) =
-					    (void *)(Lng32)res;
+					    (void *)(long)res;
 				else if (flags & QUAD)
 					*va_arg(ap, quad_t *) = res;
 				else if (flags & LONG)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/BufferReference.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/BufferReference.cpp b/core/sql/executor/BufferReference.cpp
index 442cb7d..4b6115b 100644
--- a/core/sql/executor/BufferReference.cpp
+++ b/core/sql/executor/BufferReference.cpp
@@ -31,7 +31,7 @@
 namespace ExOverflow
 {
   BufferReference::BufferReference(ByteCount bufferSize)
-    : buffer_(NULL), maxOffset_(bufferSize), offset_(NULL)
+    : buffer_(NULL), maxOffset_(bufferSize), offset_(0)
   {}
 
   BufferReference::BufferReference(const BufferReference& br)
@@ -81,7 +81,7 @@ namespace ExOverflow
   BufferReference::invalidate(void)
   {
     buffer_ = NULL;
-    offset_ = NULL;
+    offset_ = 0;
   }
 
   bool

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtil.h b/core/sql/executor/ExExeUtil.h
index 76ccfe2..9cad737 100644
--- a/core/sql/executor/ExExeUtil.h
+++ b/core/sql/executor/ExExeUtil.h
@@ -3487,7 +3487,7 @@ class ExExeUtilHiveTruncateTcb : public ExExeUtilTcb
   Step step_;
 
   int   numExistingFiles_;
-  void * lobGlob_;
+  ExLobGlobals * lobGlob_;
 };
 
 class ExExeUtilHiveTruncatePrivateState : public ex_tcb_private_state

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExeUtilCommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilCommon.cpp b/core/sql/executor/ExExeUtilCommon.cpp
index 19d11fd..6f3cb26 100644
--- a/core/sql/executor/ExExeUtilCommon.cpp
+++ b/core/sql/executor/ExExeUtilCommon.cpp
@@ -711,7 +711,7 @@ short ExExeUtilTcb::executeQuery(char * task,
 		
 		char * outBuf = new(getHeap()) char[errorBufLen+400];
 		getStatusString(task, "Error", NULL, outBuf,
-				NULL, NULL,
+				FALSE, NULL,
 				errorBuf);
 		
 		NADELETEBASIC(errorBuf, getHeap());

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExeUtilGet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilGet.cpp b/core/sql/executor/ExExeUtilGet.cpp
index a8e88be..683209c 100644
--- a/core/sql/executor/ExExeUtilGet.cpp
+++ b/core/sql/executor/ExExeUtilGet.cpp
@@ -7684,7 +7684,7 @@ short ExExeUtilLobInfoTableTcb::work()
     if (espGlobals && espGlobals->getStmtStats())
       parentQid = espGlobals->getStmtStats()->getQueryId();
   }
-  ExeCliInterface cliInterface(getHeap(), NULL, NULL, parentQid);
+  ExeCliInterface cliInterface(getHeap(), 0, NULL, parentQid);
   while (1)
     {
       switch (step_)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index 57345bf..cef633e 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -783,7 +783,7 @@ ExWorkProcRetcode ExExeUtilAqrWnrInsertTcb::work()
           dummyArg[i] = i;
   #endif
         cliRC = cliInterface()->executeImmediate(
-                                    query_, dummyArg, &len, NULL);
+                                    query_, dummyArg, &len, FALSE);
 
   #ifdef VERIFY_CLI_UTIL
         ex_assert (len == 0, "lock table returned data");
@@ -816,7 +816,7 @@ ExWorkProcRetcode ExExeUtilAqrWnrInsertTcb::work()
         Int64 rowCount = 0;
         cliRC = cliInterface()->executeImmediate(query_,
                                   (char*)&rowCount,
-                                  &len, NULL);
+                                  &len, FALSE);
         NADELETEBASIC(query_, getMyHeap());
         if (cliRC < 0)
         {
@@ -951,7 +951,7 @@ ExWorkProcRetcode ExExeUtilAqrWnrInsertTcb::work()
         Lng32 len = 0;
         char dummyArg[128];
         cliRC = cliInterface()->executeImmediate(
-                                    query_, dummyArg, &len, NULL);
+                                    query_, dummyArg, &len, FALSE);
 
         NADELETEBASIC(query_, getMyHeap());
 
@@ -2753,7 +2753,7 @@ void ExExeUtilLobExtractTcb::freeResources()
 {
   Lng32 cliRC = 0;
   Lng32 retcode = 0;
-  void * lobGlobs = getLobGlobals()->lobAccessGlobals();
+  ExLobGlobals * lobGlobs = getLobGlobals()->lobAccessGlobals();
   ContextCli *currContext =
     getGlobals()->castToExExeStmtGlobals()->castToExMasterStmtGlobals()->
     getStatement()->getContext();
@@ -2794,7 +2794,7 @@ short ExExeUtilLobExtractTcb::work()
   Lng32 retcode = 0;
   Int64 lobDataOutputLen = 0;
   Int64 requestTag = -1;
-  LobsSubOper so;
+  LobsSubOper so = Lob_None;
   // if no parent request, return
   if (qparent_.down->isEmpty())
     return WORK_OK;
@@ -2811,7 +2811,7 @@ short ExExeUtilLobExtractTcb::work()
 
   
 
-  void * lobGlobs = getLobGlobals()->lobAccessGlobals();
+  ExLobGlobals * lobGlobs = getLobGlobals()->lobAccessGlobals();
 
   ex_queue_entry * centry = NULL;
   
@@ -3448,7 +3448,7 @@ ExExeUtilFileExtractTcb::ExExeUtilFileExtractTcb
 ///////////////////////////////////////////////////////////////
 ex_tcb * ExExeUtilLobUpdateTdb::build(ex_globals * glob)
 {
-  ExExeUtilLobUpdateTcb * exe_util_lobupdate_tcb;
+  ExExeUtilLobUpdateTcb * exe_util_lobupdate_tcb = NULL;
 
   ex_tcb * childTcb = NULL;
   if (child_)
@@ -3535,7 +3535,7 @@ short ExExeUtilLobUpdateTcb::work()
   Int64 lobLen = lobTdb().updateSize();
   char * data = (char *)(lobTdb().getBufAddr());
  
-  void * lobGlobs = getLobGlobals()->lobAccessGlobals();
+  ExLobGlobals * lobGlobs = getLobGlobals()->lobAccessGlobals();
 
   while (1)
     {
@@ -3981,7 +3981,7 @@ short ExExeUtilFileExtractTcb::work()
 
   
 
-  void * lobGlobs = getLobGlobals()->lobAccessGlobals();
+  ExLobGlobals * lobGlobs = getLobGlobals()->lobAccessGlobals();
 
   while (1)
     {
@@ -4234,7 +4234,7 @@ short ExExeUtilFileLoadTcb::work()
 
   
 
-  void * lobGlobs = getLobGlobals()->lobAccessGlobals();
+  ExLobGlobals * lobGlobs = getLobGlobals()->lobAccessGlobals();
 
   while (1)
     {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExeUtilMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilMisc.cpp b/core/sql/executor/ExExeUtilMisc.cpp
index 754e299..2ed95fb 100644
--- a/core/sql/executor/ExExeUtilMisc.cpp
+++ b/core/sql/executor/ExExeUtilMisc.cpp
@@ -2270,7 +2270,7 @@ void ExExeUtilHiveTruncateTcb::freeResources()
       hiveClient->executeHiveSQL(hiveDropDDL);
     }
   if (lobGlob_) {
-    ExpLOBinterfaceCleanup(lobGlob_, getGlobals()->getDefaultHeap());
+    ExpLOBinterfaceCleanup(lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap());
     lobGlob_ = NULL;
   }
 }
@@ -2280,7 +2280,7 @@ Int32 ExExeUtilHiveTruncateTcb::fixup()
   lobGlob_ = NULL;
 
   ExpLOBinterfaceInit
-    (lobGlob_, getGlobals()->getDefaultHeap(),
+    (lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap(),
      getGlobals()->castToExExeStmtGlobals()->getContext(),FALSE, 
      htTdb().getHdfsHost(),
      htTdb().getHdfsPort());

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExplain.cpp b/core/sql/executor/ExExplain.cpp
index 0cf537b..ba142ec 100644
--- a/core/sql/executor/ExExplain.cpp
+++ b/core/sql/executor/ExExplain.cpp
@@ -125,7 +125,7 @@ ExExplainTcb::ExExplainTcb(const ExExplainTdb &explainTdb, ex_globals *glob)
   explainPlan_(NULL),
   explainPlanLen_(0),
   explainFrag_(NULL),
-  explainFragLen_(NULL),
+  explainFragLen_(0),
   diagsArea_(NULL),
   retryAttempts_(0),
   stmtName_(NULL)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExFastTransport.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExFastTransport.cpp b/core/sql/executor/ExFastTransport.cpp
index 4219702..83f338c 100644
--- a/core/sql/executor/ExFastTransport.cpp
+++ b/core/sql/executor/ExFastTransport.cpp
@@ -465,7 +465,7 @@ ExHdfsFastExtractTcb::~ExHdfsFastExtractTcb()
 {
 
   if (lobGlob_) {
-    ExpLOBinterfaceCleanup(lobGlob_, getGlobals()->getDefaultHeap());
+    ExpLOBinterfaceCleanup(lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap());
     lobGlob_ = NULL;
   }
 
@@ -485,7 +485,7 @@ Int32 ExHdfsFastExtractTcb::fixup()
   strncpy(hdfsHost_, myTdb().getHdfsHostName(), sizeof(hdfsHost_));
   hdfsPort_ = myTdb().getHdfsPortNum();
   ExpLOBinterfaceInit
-    (lobGlob_, getGlobals()->getDefaultHeap(),getGlobals()->castToExExeStmtGlobals()->getContext(),TRUE,hdfsHost_,hdfsPort_);
+    (lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap(),getGlobals()->castToExExeStmtGlobals()->getContext(),TRUE,hdfsHost_,hdfsPort_);
   
   modTS_ = myTdb().getModTSforDir();
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExFastTransport.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExFastTransport.h b/core/sql/executor/ExFastTransport.h
index 7ad950e..22b6cb0 100644
--- a/core/sql/executor/ExFastTransport.h
+++ b/core/sql/executor/ExFastTransport.h
@@ -415,7 +415,7 @@ protected:
     return strlen(myTdb().getNullString()) == 0;
   }
 
-  void * lobGlob_;
+  ExLobGlobals * lobGlob_;
 
   char hdfsHost_[500];
   int  hdfsPort_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExHbaseAccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseAccess.cpp b/core/sql/executor/ExHbaseAccess.cpp
index c9faba3..deababb 100644
--- a/core/sql/executor/ExHbaseAccess.cpp
+++ b/core/sql/executor/ExHbaseAccess.cpp
@@ -2840,7 +2840,7 @@ short ExHbaseAccessTcb::createDirectRowBuffer( UInt16 tuppIndex,
   char *colVal;
   char *str;
   NABoolean prependNullVal;
-  char nullValChar;
+  char nullValChar = 0;
   Attributes * attr;
   int numCols = 0;
   short *numColsPtr;
@@ -3344,7 +3344,7 @@ ExWorkProcRetcode ExHbaseAccessBulkLoadTaskTcb::work()
   short rc = 0;
   Queue * indexList = NULL; // this list includes the base table too.
   char * indexName ;
-  NABoolean cleanupAfterComplete;
+  NABoolean cleanupAfterComplete = FALSE;
   Text tabName;
 
   // if no parent request, return

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index 3b9baa5..b7a476c 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -280,7 +280,7 @@ void ExHdfsScanTcb::freeResources()
   }
   deallocateRuntimeRanges();
   if (lobGlob_) { 
-     ExpLOBinterfaceCleanup(lobGlob_, getGlobals()->getDefaultHeap());
+     ExpLOBinterfaceCleanup(lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap());
      lobGlob_ = NULL;
   }
 }
@@ -340,7 +340,7 @@ Int32 ExHdfsScanTcb::fixup()
   lobGlob_ = NULL;
 
   ExpLOBinterfaceInit
-    (lobGlob_, getGlobals()->getDefaultHeap(),getGlobals()->castToExExeStmtGlobals()->getContext(),TRUE, hdfsScanTdb().hostName_,hdfsScanTdb().port_);
+    (lobGlob_, (NAHeap *)getGlobals()->getDefaultHeap(),getGlobals()->castToExExeStmtGlobals()->getContext(),TRUE, hdfsScanTdb().hostName_,hdfsScanTdb().port_);
   
   return 0;
 }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExHdfsScan.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.h b/core/sql/executor/ExHdfsScan.h
index 6a8baef..27ea27f 100644
--- a/core/sql/executor/ExHdfsScan.h
+++ b/core/sql/executor/ExHdfsScan.h
@@ -252,7 +252,7 @@ protected:
                                       // with only the required columns. 
   hdfsFile hdfsFp_;
 
-  void * lobGlob_;
+  ExLobGlobals *lobGlob_;
 
   Int64 requestTag_;
   Int64 hdfsScanBufMaxSize_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExSMEvent.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExSMEvent.cpp b/core/sql/executor/ExSMEvent.cpp
index 6bd2f4a..18bb7f1 100644
--- a/core/sql/executor/ExSMEvent.cpp
+++ b/core/sql/executor/ExSMEvent.cpp
@@ -116,10 +116,10 @@ struct ExSMEventTrace
 
       printf("[%d] %d.%09ld %s ", (int) index,
              (int) e.ts_.tv_sec, (long int) e.ts_.tv_nsec, e.fn_);
-      printf("%d:%d:%" PRId64 ":%d:0x%c ", (int) t.node, (int) t.pid, t.id,
+      printf("%d:%d:%ld :%d:0x%c ", (int) t.node, (int) t.pid, t.id,
              (int) ExSMTag_GetTagWithoutQualifier(t.tag),
              (char) ExSMTag_GetQualifierDisplay(t.tag));
-      printf("%"PRId64" %"PRId64" %"PRId64" %"PRId64" %"PRId64"\n",
+      printf("%ld %ld %ld %ld %ld\n",
              opt[0], opt[1], opt[2], opt[3], opt[4]);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExSMTaskList.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExSMTaskList.cpp b/core/sql/executor/ExSMTaskList.cpp
index 5a045ff..698c63b 100644
--- a/core/sql/executor/ExSMTaskList.cpp
+++ b/core/sql/executor/ExSMTaskList.cpp
@@ -72,7 +72,7 @@ ExSMTaskList::~ExSMTaskList()
 {
   delete [] buckets_;
   EXSM_TRACE(EXSM_TRACE_INIT,
-             "TASK LIST DTOR %p inserts %"PRId64" collisions %"PRId64,
+             "TASK LIST DTOR %p inserts %ld collisions %ld",
              this, numInserts_, numCollisions_);
 
   int rc = pthread_mutex_destroy(&taskListMutex_);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExStats.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExStats.cpp b/core/sql/executor/ExStats.cpp
index dd5c119..23d9c0d 100644
--- a/core/sql/executor/ExStats.cpp
+++ b/core/sql/executor/ExStats.cpp
@@ -6940,7 +6940,7 @@ NABoolean ExStatisticsArea::appendCpuStats(ExStatisticsArea *stats,
   ExOperStats *stat;
   ExOperStats::StatType statType;
   NABoolean retcode = FALSE;
-  NABoolean retcode1;
+  NABoolean retcode1 = FALSE;
 
   stats->position();
   while ((stat = stats->getNext()) != NULL) {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ExUdrServer.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExUdrServer.cpp b/core/sql/executor/ExUdrServer.cpp
index bcd01be..07c8009 100644
--- a/core/sql/executor/ExUdrServer.cpp
+++ b/core/sql/executor/ExUdrServer.cpp
@@ -697,7 +697,7 @@ ExUdrServer::ExUdrServerStatus ExUdrServer::stop()
 ExUdrServer::ExUdrServerStatus ExUdrServer::kill(ComDiagsArea *diags)
 {
   UdrDebug1("[BEGIN ExUdrServer::kill()] %p", this);
-  short result;
+  short result = 0;
 
   char asciiPhandle[300];
   serverProcessId_.toAscii(asciiPhandle, 300);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/HBaseClient_JNI.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/HBaseClient_JNI.cpp b/core/sql/executor/HBaseClient_JNI.cpp
index da05b6c..6700cff 100644
--- a/core/sql/executor/HBaseClient_JNI.cpp
+++ b/core/sql/executor/HBaseClient_JNI.cpp
@@ -119,7 +119,7 @@ HBaseClient_JNI::HBaseClient_JNI(NAHeap *heap, int debugPort, int debugTimeout)
                    ,isConnected_(FALSE)
 {
   for (int i=0; i<NUM_HBASE_WORKER_THREADS; i++) {
-    threadID_[i] = NULL;
+    threadID_[i] = 0;
   }
 }
 
@@ -1104,7 +1104,7 @@ Int32 HBaseClient_JNI::getRegionStatsEntries()
   QRLogger::log(CAT_SQL_HBASE, LL_DEBUG, "HBaseClient_JNI::getRegionStatsEntries() called.");
 
   if (initJNIEnv() != JOI_OK)
-     return NULL;
+     return 0;
 
   tsRecentJMFromJNI = JavaMethods_[JM_GET_REGION_STATS_ENTRIES].jm_full_name;
   jint numEntries = 
@@ -1116,7 +1116,7 @@ Int32 HBaseClient_JNI::getRegionStatsEntries()
     logError(CAT_SQL_HBASE, __FILE__, __LINE__);
     logError(CAT_SQL_HBASE, "HBaseClient_JNI::getRegionStatsEntries()", getLastError());
     jenv_->PopLocalFrame(NULL);
-    return NULL;
+    return 0;
   }
 
   jenv_->PopLocalFrame(NULL);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/cluster.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/cluster.cpp b/core/sql/executor/cluster.cpp
index a8610c6..69e863b 100644
--- a/core/sql/executor/cluster.cpp
+++ b/core/sql/executor/cluster.cpp
@@ -1149,7 +1149,7 @@ Cluster::Cluster(ClusterState state,
     ,afterLastBufferToRead_(NULL)
     ,numLoops_(0)
     ,startTimePhase3_(0)
-    ,keepRecentBuffer_(FALSE)
+    ,keepRecentBuffer_(NULL)
     ,flushMe_(FALSE)
     ,defragBuffer_(NULL)
 {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ex_globals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_globals.cpp b/core/sql/executor/ex_globals.cpp
index 5d6739d..e6f5252 100644
--- a/core/sql/executor/ex_globals.cpp
+++ b/core/sql/executor/ex_globals.cpp
@@ -85,12 +85,15 @@ ex_globals::ex_globals(short num_temps,
   lobGlobals_ = new(heap_) LOBglobals(heap_);
 }
 
-void *& ex_globals::getExLobGlobal() { return lobGlobals()->lobAccessGlobals(); }
+ExLobGlobals *&ex_globals::getExLobGlobal() 
+{ 
+   return lobGlobals()->lobAccessGlobals(); 
+}
 
-void ex_globals::initLOBglobal(void *context)
+void ex_globals::initLOBglobal(ContextCli *context)
 {
   // initialize lob interface
-  ExpLOBoper::initLOBglobal(getExLobGlobal(), heap_, context,(char *)"default",0);
+  ExpLOBoper::initLOBglobal(getExLobGlobal(), (NAHeap *)heap_, context, (char *)"default", (Int32)0);
 
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/ex_globals.h
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_globals.h b/core/sql/executor/ex_globals.h
index 27e2ae2..9a84a73 100644
--- a/core/sql/executor/ex_globals.h
+++ b/core/sql/executor/ex_globals.h
@@ -59,6 +59,8 @@ class StatsGlobals;
 class sql_buffer_pool;
 class LOBglobals;
 class SequenceValueGenerator;
+class ExLobGlobals;
+class ContextCli;
 
 /////////////////////////////////////////////////////////////
 // class ex_globals
@@ -185,10 +187,10 @@ public:
   inline sql_buffer_pool *getSharedPool() { return sharedPool_; }
   inline void setSharedPool(sql_buffer_pool *p) { sharedPool_ = p; }
 
-  void *& getExLobGlobal();
+  ExLobGlobals *&getExLobGlobal();
   LOBglobals * lobGlobals() { return lobGlobals_; }
   
-  void initLOBglobal(void *context);
+  void initLOBglobal(ContextCli *context);
   
   SequenceValueGenerator * seqGen();
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/hash_table.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/hash_table.cpp b/core/sql/executor/hash_table.cpp
index d2baf63..9e8fed0 100644
--- a/core/sql/executor/hash_table.cpp
+++ b/core/sql/executor/hash_table.cpp
@@ -125,7 +125,7 @@ void HashTable::init() {
   // memset is about six times faster than this loop
   //     for (unsigned long i = 0; i < headerCount_; i++)
   //        header_[i].init();
-  memset( header_ , NULL, headerCount_ * sizeof(HashTableHeader) );
+  memset( header_ , 0, headerCount_ * sizeof(HashTableHeader) );
 }
 
 //////////////////////////////////////////////////////////////////////
@@ -255,7 +255,7 @@ ULng32 HashTable::resize(NABoolean enoughMemory) {
   }
 
   // initialize new HT
-  memset( newHeader , NULL, newSize * sizeof(HashTableHeader) );
+  memset( newHeader , 0, newSize * sizeof(HashTableHeader) );
 
   // insert entries from the old HT into the new HT
   for ( ULng32 oldind = 0; oldind < headerCount_; oldind++ ) {

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/executor/hiveHook.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/hiveHook.cpp b/core/sql/executor/hiveHook.cpp
index 0289423..11003f9 100644
--- a/core/sql/executor/hiveHook.cpp
+++ b/core/sql/executor/hiveHook.cpp
@@ -538,12 +538,12 @@ NABoolean populateSerDeParams(HiveMetaData *md, Int32 serdeID,
   std::size_t foundB ;
   if (!findAToken(md, tblStr, pos, "serdeInfo:",
                   "populateSerDeParams::serdeInfo:###"))
-    return NULL;
+    return FALSE;
 
   std::size_t foundE = pos ;
   if (!findAToken(md, tblStr, foundE, "}),",
                   "populateSerDeParams::serDeInfo:)},###"))
-    return NULL;
+    return FALSE;
   
   const char * nullStr = "serialization.null.format=";
   const char * fieldStr = "field.delim" ;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/exp/ExpAtp.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpAtp.cpp b/core/sql/exp/ExpAtp.cpp
index 5de3263..827c1f7 100644
--- a/core/sql/exp/ExpAtp.cpp
+++ b/core/sql/exp/ExpAtp.cpp
@@ -200,7 +200,7 @@ Lng32 atp_struct::unpack(Lng32 base)
   if (criDesc_)
   {
     criDesc_ = (ex_cri_desc *)CONVERT_TO_PTR(criDesc_, base);
-    if (criDesc_->driveUnpack((void *)base,&obj,NULL) == NULL) return -1;
+    if (criDesc_->driveUnpack((void *)((long)base),&obj,NULL) == NULL) return -1;
     for (Int32 i = 0; i < criDesc_->noTuples(); i++)
     {
       tuppArray_[i].unpack(base);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/ec9ec171/core/sql/exp/ExpConvMxcs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpConvMxcs.cpp b/core/sql/exp/ExpConvMxcs.cpp
index 82be17a..5a8b03e 100644
--- a/core/sql/exp/ExpConvMxcs.cpp
+++ b/core/sql/exp/ExpConvMxcs.cpp
@@ -1608,7 +1608,7 @@ static short convIntervalToAsciiMxcs(char *source,
     }
 
   Int64 factor = 1;
-  Int64 fieldVal;
+  Int64 fieldVal = 0;
   if (fractionPrecision)
   {
     //    realTargetLen += fractionPrecision + 1; // 1 for '.'