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/09/29 23:56:32 UTC

[09/13] incubator-trafodion git commit: [TRAFODION-2754] Get statistics cores sqlci or mxosrvr at str_sprintf()

[TRAFODION-2754] Get statistics cores sqlci or mxosrvr at str_sprintf()

Switched str_sprinf to use the standard sprintf function to ensure
that the format specification and the passed in parameters are consistent


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

Branch: refs/heads/master
Commit: 8fd4987967a35cf5fda14089c4715e6142ee85e9
Parents: 2953e8c
Author: selvaganesang <se...@esgyn.com>
Authored: Wed Sep 27 17:54:39 2017 +0000
Committer: selvaganesang <se...@esgyn.com>
Committed: Wed Sep 27 17:54:39 2017 +0000

----------------------------------------------------------------------
 core/sql/arkcmp/CmpSqlSession.cpp         |   2 +-
 core/sql/cli/Cli.cpp                      |  54 ++---
 core/sql/cli/Statement.cpp                |   2 +-
 core/sql/clitest/blobtest.cpp             |  20 +-
 core/sql/comexe/ComTdb.cpp                |   2 +-
 core/sql/comexe/ComTdbExeUtil.cpp         |   8 +-
 core/sql/comexe/ComTdbExeUtil.h           |   2 +-
 core/sql/comexe/ComTdbFastTransport.cpp   |   4 +-
 core/sql/comexe/ComTdbFirstN.cpp          |   2 +-
 core/sql/comexe/ComTdbHashj.cpp           |   2 +-
 core/sql/comexe/ComTdbHbaseAccess.cpp     |   8 +-
 core/sql/comexe/ComTdbHdfsScan.cpp        |  22 +-
 core/sql/comexe/ComTdbHdfsScan.h          |   2 +
 core/sql/comexe/ComTdbMj.cpp              |   2 +-
 core/sql/comexe/ComTdbOnlj.cpp            |   2 +-
 core/sql/comexe/ComTdbProbeCache.cpp      |   2 +-
 core/sql/comexe/ComTdbRoot.cpp            |  16 +-
 core/sql/comexe/ComTdbSendBottom.cpp      |   2 +-
 core/sql/comexe/ComTdbSendTop.cpp         |   2 +-
 core/sql/comexe/ComTdbSequence.cpp        |   2 +-
 core/sql/comexe/ComTdbSort.cpp            |   4 +-
 core/sql/comexe/ComTdbSortGrby.cpp        |   2 +-
 core/sql/comexe/ComTdbSplitBottom.cpp     |   8 +-
 core/sql/comexe/ComTdbSplitTop.cpp        |   4 +-
 core/sql/comexe/ComTdbTupleFlow.cpp       |   2 +-
 core/sql/comexe/ComTdbUdr.cpp             |   4 +-
 core/sql/comexe/ComTdbUnPackRows.cpp      |   2 +-
 core/sql/comexe/ComTdbUnion.cpp           |   2 +-
 core/sql/common/ComSqlId.cpp              |   4 +-
 core/sql/common/ComViewColUsage.h         |   2 +-
 core/sql/common/IpcGuardian.cpp           |   2 +-
 core/sql/common/str.cpp                   | 291 -------------------------
 core/sql/common/str.h                     |   1 +
 core/sql/executor/ExExeUtilExplain.cpp    |   2 +-
 core/sql/executor/ExExeUtilGet.cpp        |  49 ++---
 core/sql/executor/ExExeUtilLoad.cpp       |  10 +-
 core/sql/executor/ExExeUtilMisc.cpp       |   8 +-
 core/sql/executor/ExExplain.cpp           |   2 +-
 core/sql/executor/ExFastTransport.cpp     |   2 +-
 core/sql/executor/ExHbaseAccess.cpp       |   2 +-
 core/sql/executor/ExHdfsScan.cpp          |   2 +-
 core/sql/executor/ExSMGlobals.cpp         |   2 +-
 core/sql/executor/ex_hashj.cpp            |   2 +-
 core/sql/exp/ExpLOB.cpp                   |  18 +-
 core/sql/exp/ExpLOBaccess.cpp             |  58 ++---
 core/sql/exp/ExpPCode.cpp                 |   8 +-
 core/sql/exp/exp_attrs.cpp                |   6 +-
 core/sql/exp/exp_clause.cpp               |   8 +-
 core/sql/exp/exp_datetime.cpp             |   2 +-
 core/sql/exp/exp_expr.cpp                 |   2 +-
 core/sql/generator/GenExplain.cpp         |  12 +-
 core/sql/generator/GenRelEnforcer.cpp     |   2 +-
 core/sql/optimizer/BindItemExpr.cpp       |   4 +-
 core/sql/optimizer/CmpProcess.cpp         |   2 +-
 core/sql/sort/Qsort.cpp                   |   2 +-
 core/sql/sort/SortUtil.cpp                |  12 +-
 core/sql/sqlci/SqlCmd.cpp                 |   2 +-
 core/sql/sqlcomp/CmpDescribe.cpp          |   6 +-
 core/sql/sqlcomp/CmpSeabaseDDLauth.cpp    |   2 +-
 core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp |  55 +++--
 core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp  | 112 +++++-----
 core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp |  14 +-
 core/sql/sqlcomp/CmpSeabaseDDLschema.cpp  |   4 +-
 core/sql/sqlcomp/CmpSeabaseDDLtable.cpp   | 104 ++++-----
 core/sql/sqlcomp/CmpSeabaseDDLupgrade.cpp |  18 +-
 core/sql/sqlcomp/CmpSeabaseDDLview.cpp    |   8 +-
 66 files changed, 369 insertions(+), 659 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/arkcmp/CmpSqlSession.cpp
----------------------------------------------------------------------
diff --git a/core/sql/arkcmp/CmpSqlSession.cpp b/core/sql/arkcmp/CmpSqlSession.cpp
index 962e754..06ec7bf 100644
--- a/core/sql/arkcmp/CmpSqlSession.cpp
+++ b/core/sql/arkcmp/CmpSqlSession.cpp
@@ -242,7 +242,7 @@ void CmpSqlSession::setSessionId(NAString &sessionID)
 	 sessionUniqNum,
 	 userNameLen, NULL,
 	 userSessionNameLen, NULL);
-      str_sprintf(sName, "%02d%03Ld%06Ld%018Ld%010Ld",
+      str_sprintf(sName, "%02d%03ld%06ld%018ld%010ld",
 		  ComSqlId::SQ_SQL_ID_VERSION,
 		  segmentNum_, pin_l, schemaNameCreateTime,
 		  sessionUniqNum);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/cli/Cli.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Cli.cpp b/core/sql/cli/Cli.cpp
index 1fdc61c..d351202 100644
--- a/core/sql/cli/Cli.cpp
+++ b/core/sql/cli/Cli.cpp
@@ -2550,7 +2550,7 @@ Lng32 SQLCLI_ProcessRetryQuery(
 			    stringParam1 = (char*)errCond->getOptionalString(0);
 			  intParam1 = errCond->getOptionalInteger(0);
 			  
-			  str_sprintf(emsText, "AutoQueryRetry will be attempted for Sqlcode=%d, Nskcode=%d, StringParam=%s, IntParam=%s",
+			  str_sprintf(emsText, "AutoQueryRetry will be attempted for Sqlcode=%d, Nskcode=%d, StringParam=%s, IntParam=%d",
 				      sqlcode, nskcode, 
 				      (stringParam1 ? stringParam1 : "NULL"),
 				      (intParam1 != ComDiags_UnInitialized_Int
@@ -8501,7 +8501,7 @@ Lng32 SQLCLI_LOBcliInterface
 				       &inDescSyskey, &descPartnKey,
 				       &schNameLen, schName,
 				       inLobHandle);
-      str_sprintf(logBuf,"Handle contents : flags %d, lobType %d, lobNum :%d, uid : %Ld, descSyskey: %Ld, descPartnKey : %Ld, schNameLen:%d, schName %s", flags,lobType,lobNum,uid,inDescSyskey,descPartnKey,schNameLen,schName);
+      str_sprintf(logBuf,"Handle contents : flags %d, lobType %d, lobNum :%d, uid : %ld, descSyskey: %ld, descPartnKey : %ld, schNameLen:%d, schName %s", flags,lobType,lobNum,uid,inDescSyskey,descPartnKey,schNameLen,schName);
        lobDebugInfo(logBuf,0,__LINE__,lobTrace);
     }
 
@@ -8709,7 +8709,7 @@ Lng32 SQLCLI_LOBcliInterface
     case LOB_CLI_INSERT:
       {
 	// insert into lob descriptor handle table
-	str_sprintf(query, "select syskey from (insert into table(ghost table %s) values (%Ld, 1, %Ld)) x",
+	str_sprintf(query, "select syskey from (insert into table(ghost table %s) values (%ld, 1, %ld)) x",
 		    lobDescHandleName, descPartnKey, (dataLen ? *dataLen : 0));
         lobDebugInfo(query,0,__LINE__,lobTrace);
 	// set parserflags to allow ghost table
@@ -8733,7 +8733,7 @@ Lng32 SQLCLI_LOBcliInterface
         if (blackBox && (blackBoxLen && (*blackBoxLen > 0)))
           {
             //blackBox points to external file name
-            str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, 1, %Ld, %Ld, '%s')",
+            str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, 1, %ld, %ld, '%s')",
                         lobDescChunksName, descPartnKey, descSyskey,
                         (dataLen ? *dataLen : 0),
                         (dataOffset ? *dataOffset : 0),
@@ -8742,7 +8742,7 @@ Lng32 SQLCLI_LOBcliInterface
           }
         else
           {
-            str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, 1, %Ld, %Ld, NULL)",
+            str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, 1, %ld, %ld, NULL)",
                         lobDescChunksName, descPartnKey, descSyskey,
                         (dataLen ? *dataLen : 0),
                         (dataOffset ? *dataOffset : 0));
@@ -8794,7 +8794,7 @@ Lng32 SQLCLI_LOBcliInterface
             cliRC = -LOB_DESC_APPEND_ERROR;       
             goto error_return;
           } 
-	str_sprintf(query, "update table(ghost table %s) set numChunks = numChunks + 1, lobLen = lobLen + %Ld where descPartnKey = %Ld and syskey = %Ld",
+	str_sprintf(query, "update table(ghost table %s) set numChunks = numChunks + 1, lobLen = lobLen + %ld where descPartnKey = %ld and syskey = %ld",
 		    lobDescHandleName, 
 		    (dataLen ? *dataLen : 0),
 		    descPartnKey, inDescSyskey);
@@ -8812,7 +8812,7 @@ Lng32 SQLCLI_LOBcliInterface
 	    goto error_return;
 	  }
 
-	str_sprintf(query, "select numChunks from table(ghost table %s) h where h.descPartnKey = %Ld and h.syskey = %Ld for read committed access",
+	str_sprintf(query, "select numChunks from table(ghost table %s) h where h.descPartnKey = %ld and h.syskey = %ld for read committed access",
 		    lobDescHandleName,  
 		    descPartnKey, inDescSyskey);
 
@@ -8835,7 +8835,7 @@ Lng32 SQLCLI_LOBcliInterface
 	// insert into lob descriptor chunks table
 	if (blackBox && (blackBoxLen && (*blackBoxLen > 0)))
 	  {
-	    str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, %d, %Ld, %Ld, '%s')",
+	    str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, %d, %ld, %ld, '%s')",
 			lobDescChunksName, descPartnKey, inDescSyskey, 
 			numChunks, (dataLen ? *dataLen : 0),
 			(dataOffset ? *dataOffset : 0),
@@ -8844,7 +8844,7 @@ Lng32 SQLCLI_LOBcliInterface
 	  }
 	else
 	  {
-	    str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, %d, %Ld, %Ld, NULL)",
+	    str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, %d, %ld, %ld, NULL)",
 			lobDescChunksName, descPartnKey, inDescSyskey, 
 			numChunks, (dataLen ? *dataLen : 0),
 			(dataOffset ? *dataOffset : 0)
@@ -8884,7 +8884,7 @@ Lng32 SQLCLI_LOBcliInterface
   case LOB_CLI_UPDATE_UNIQUE:
       {
 	// update desc handle table
-	str_sprintf(query, "update table(ghost table %s) set numChunks = 1, lobLen = %Ld where descPartnKey = %Ld and syskey = %Ld",
+	str_sprintf(query, "update table(ghost table %s) set numChunks = 1, lobLen = %ld where descPartnKey = %ld and syskey = %ld",
 		    lobDescHandleName, 
 		    (dataLen ? *dataLen : 0),
 		    descPartnKey, inDescSyskey);
@@ -8906,7 +8906,7 @@ Lng32 SQLCLI_LOBcliInterface
 
 
 	// delete all chunks from lob descriptor chunks table
-	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %Ld and descSysKey = %Ld",
+	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %ld and descSysKey = %ld",
 		    lobDescChunksName, descPartnKey, inDescSyskey);
 
 	// set parserflags to allow ghost table
@@ -8933,7 +8933,7 @@ Lng32 SQLCLI_LOBcliInterface
 	// insert the new chunk into lob descriptor chunks table
 	if (blackBox && (blackBoxLen && (*blackBoxLen > 0)))
 	  {
-	    str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, 1, %Ld, %Ld, '%s')",
+	    str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, 1, %ld, %ld, '%s')",
 			lobDescChunksName, descPartnKey, inDescSyskey,
 			(dataLen ? *dataLen : 0),
 			(dataOffset ? *dataOffset : 0),
@@ -8942,7 +8942,7 @@ Lng32 SQLCLI_LOBcliInterface
 	  }
 	else
 	  {
-	   str_sprintf(query, "insert into table(ghost table %s) values (%Ld, %Ld, 1, %Ld, %Ld, NULL)",
+	   str_sprintf(query, "insert into table(ghost table %s) values (%ld, %ld, 1, %ld, %ld, NULL)",
 			lobDescChunksName, descPartnKey, inDescSyskey,
 			(dataLen ? *dataLen : 0),
 			(dataOffset ? *dataOffset : 0));
@@ -8984,7 +8984,7 @@ Lng32 SQLCLI_LOBcliInterface
     case LOB_CLI_DELETE:
       {
 	// delete from lob descriptor handle table
-	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %Ld and syskey = %Ld",
+	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %ld and syskey = %ld",
 		    lobDescHandleName, descPartnKey, inDescSyskey);
         lobDebugInfo(query,0,__LINE__,lobTrace);
 	// set parserflags to allow ghost table
@@ -9002,7 +9002,7 @@ Lng32 SQLCLI_LOBcliInterface
 	  }
 
 	// delete from lob descriptor chunks table
-	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %Ld and descSysKey = %Ld",
+	str_sprintf(query, "delete from table(ghost table %s) where descPartnKey = %ld and descSysKey = %ld",
 		    lobDescChunksName, descPartnKey, inDescSyskey);
         lobDebugInfo(query,0,__LINE__,lobTrace);
 	// set parserflags to allow ghost table
@@ -9026,7 +9026,7 @@ Lng32 SQLCLI_LOBcliInterface
       {
 	// check if there are multiple chunks.
 	Int32 numChunks = 0;
-	str_sprintf(query, "select numChunks from table(ghost table %s) where descPartnKey = %Ld for read committed access",
+	str_sprintf(query, "select numChunks from table(ghost table %s) where descPartnKey = %ld for read committed access",
 		    lobDescHandleName,
 		    descPartnKey);
         lobDebugInfo(query,0,__LINE__,lobTrace);
@@ -9086,7 +9086,7 @@ Lng32 SQLCLI_LOBcliInterface
 	
 	// This lob has only one chunk. Read and return the single descriptor.
       
-	str_sprintf(query, "select c.chunkLen, c.dataOffset ,c.stringParam from table(ghost table %s) h, table(ghost table %s) c where h.descPartnKey = c.descPartnKey and h.syskey = c.descSyskey and h.descPartnKey = %Ld and h.syskey = %Ld and c.chunkNum = h.numChunks for read committed access",
+	str_sprintf(query, "select c.chunkLen, c.dataOffset ,c.stringParam from table(ghost table %s) h, table(ghost table %s) c where h.descPartnKey = c.descPartnKey and h.syskey = c.descSyskey and h.descPartnKey = %ld and h.syskey = %ld and c.chunkNum = h.numChunks for read committed access",
 		    lobDescHandleName, lobDescChunksName, 
 		    descPartnKey, inDescSyskey);
          
@@ -9175,7 +9175,7 @@ Lng32 SQLCLI_LOBcliInterface
 
    case LOB_CLI_SELECT_CURSOR:
       {
-	str_sprintf(query, "select dataOffset, chunkLen, stringParam from table(ghost table %s) where descPartnKey = %Ld and descSyskey = %Ld order by chunkNum for read committed access",
+	str_sprintf(query, "select dataOffset, chunkLen, stringParam from table(ghost table %s) where descPartnKey = %ld and descSyskey = %ld order by chunkNum for read committed access",
 		    lobDescChunksName, descPartnKey, inDescSyskey);
         lobDebugInfo(query,0,__LINE__,lobTrace);
 	// set parserflags to allow ghost table
@@ -9308,7 +9308,7 @@ Lng32 SQLCLI_LOBcliInterface
 	
 	//aggregate on chunklen for this lob.
 
-	str_sprintf (query,  "select sum(chunklen) from  %s   where descpartnkey = %Ld and descsyskey = %Ld ", lobDescChunksName, descPartnKey, inDescSyskey );
+	str_sprintf (query,  "select sum(chunklen) from  %s   where descpartnkey = %ld and descsyskey = %ld ", lobDescChunksName, descPartnKey, inDescSyskey );
         lobDebugInfo(query,0,__LINE__,lobTrace);
 	// set parserflags to allow ghost table
 	currContext.setSqlParserFlags(0x1);
@@ -9439,7 +9439,7 @@ Lng32 SQLCLI_LOB_GC_Interface
 				       &schNameLen, schName,
 				       handle);
     }
-  str_sprintf(logBuf,"flags %d, lobType %d, lobNum :%d, uid : %Ld, descSyskey: %Ld, descPartnKey : %Ld, schNameLen:%d, schName %s", flags,lobType,lobNum,uid,inDescSyskey,inDescPartnKey,schNameLen,schName);
+  str_sprintf(logBuf,"flags %d, lobType %d, lobNum :%d, uid : %ld, descSyskey: %ld, descPartnKey : %ld, schNameLen:%d, schName %s", flags,lobType,lobNum,uid,inDescSyskey,inDescPartnKey,schNameLen,schName);
   lobDebugInfo(logBuf,0,__LINE__,lobTrace);
   char tgtLobNameBuf[100];
   char * tgtLobName = 
@@ -9474,7 +9474,7 @@ Lng32 SQLCLI_LOB_GC_Interface
   Int64 numEntries = 0;
   Lng32 len;
   cliRC = cliInterface->executeImmediate(query, (char*)&numEntries, &len, FALSE);
-  str_sprintf(logBuf,"Number of entries in descchunktable %s is %d",lobDescChunksName, numEntries);
+  str_sprintf(logBuf,"Number of entries in descchunktable %s is %ld",lobDescChunksName, numEntries);
    lobDebugInfo(logBuf,0,__LINE__,lobTrace);
   currContext.resetSqlParserFlags(0x1);
 
@@ -9548,7 +9548,7 @@ Lng32 SQLCLI_LOB_GC_Interface
       dcInMemoryArray[i].setChunkLen(chunkLen);
       dcInMemoryArray[i].setChunkNum(chunkNum);
 
-      str_sprintf(logBuf,"Fetched for entry i=%d; currentOffset:%Ld, descPartnKey:%Ld, sysKey:%Ld, chunkLen:%Ld,chunkNum %d", i,currentOffset,descPartnKey,descSyskey,chunkLen,chunkNum);
+      str_sprintf(logBuf,"Fetched for entry i=%d; currentOffset:%ld, descPartnKey:%ld, sysKey:%ld, chunkLen:%ld,chunkNum %ld", i,currentOffset,descPartnKey,descSyskey,chunkLen,chunkNum);
       lobDebugInfo(logBuf,0,__LINE__,lobTrace);
 
       cliRC = cliInterface->fetch();
@@ -9589,7 +9589,7 @@ Lng32 SQLCLI_LOB_GC_Interface
       else
         {
          
-          str_sprintf(query, "update table(ghost table %s) set dataOffset=%Ld, chunkLen = %Ld where descPartnKey = %Ld and descSysKey = %Ld",
+          str_sprintf(query, "update table(ghost table %s) set dataOffset=%ld, chunkLen = %ld where descPartnKey = %ld and descSysKey = %ld",
                       lobDescChunksName, 
                       dcInMemoryArray[i].getNewOffset(),
                       dcInMemoryArray[i].getChunkLen(),
@@ -10462,7 +10462,7 @@ static Lng32 SeqGenCliInterfacePrepQry(
 			  &currContext,
 			  NULL);
       
-      str_sprintf(stmtName, "%s_%Ld", qryName, sga->getSGObjectUID().get_value());
+      str_sprintf(stmtName, "%s_%ld", qryName, sga->getSGObjectUID().get_value());
       
       doPrep = TRUE;
     }
@@ -10535,7 +10535,7 @@ static Lng32 SeqGenCliInterfaceUpdAndValidate(
       if (! cliInterfaceArr[SEQ_UPD_TS_QRY_IDX])
         {
           cliRC = SeqGenCliInterfacePrepQry(
-                                            "update %s.\"%s\".%s set upd_ts = cast(? as largeint not null) where seq_uid = %Ld",
+                                            "update %s.\"%s\".%s set upd_ts = cast(? as largeint not null) where seq_uid = %ld",
                                             SEQ_UPD_TS_QRY_IDX,
                                             "SEQ_UPD_TS_QRY_IDX",
                                             cliInterfaceArr, sga, myDiags, currContext, diags, exHeap);
@@ -10576,7 +10576,7 @@ static Lng32 SeqGenCliInterfaceUpdAndValidate(
   if (! cliInterfaceArr[SEQ_PROCESS_QRY_IDX])
     {
       cliRC = SeqGenCliInterfacePrepQry(
-                                        "select  case when cast(? as largeint not null) = 1 then t.startVal else t.nextValue end, t.redefTS from (update %s.\"%s\".%s set next_value = (case when cast(? as largeint not null) = 1 then start_value + cast(? as largeint not null) else (case when next_value + cast(? as largeint not null) > max_value then max_value+1 else next_value + cast(? as largeint not null) end) end), num_calls = num_calls + 1 where seq_uid = %Ld return old.start_value, old.next_value, old.redef_ts) t(startVal, nextValue, redefTS);",
+                                        "select  case when cast(? as largeint not null) = 1 then t.startVal else t.nextValue end, t.redefTS from (update %s.\"%s\".%s set next_value = (case when cast(? as largeint not null) = 1 then start_value + cast(? as largeint not null) else (case when next_value + cast(? as largeint not null) > max_value then max_value+1 else next_value + cast(? as largeint not null) end) end), num_calls = num_calls + 1 where seq_uid = %ld return old.start_value, old.next_value, old.redef_ts) t(startVal, nextValue, redefTS);",
                                         SEQ_PROCESS_QRY_IDX,
                                         "SEQ_PROCESS_QRY_IDX",
                                         cliInterfaceArr, sga, myDiags, currContext, diags, exHeap);
@@ -10641,7 +10641,7 @@ static Lng32 SeqGenCliInterfaceUpdAndValidate(
       if (! cliInterfaceArr[SEQ_SEL_TS_QRY_IDX])
         {
           cliRC = SeqGenCliInterfacePrepQry(
-                                            "select upd_ts from %s.\"%s\".%s where seq_uid = %Ld",
+                                            "select upd_ts from %s.\"%s\".%s where seq_uid = %ld",
                                             SEQ_SEL_TS_QRY_IDX,
                                             "SEQ_SEL_TS_QRY_IDX",
                                             cliInterfaceArr, sga, myDiags, currContext, diags, exHeap);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/cli/Statement.cpp
----------------------------------------------------------------------
diff --git a/core/sql/cli/Statement.cpp b/core/sql/cli/Statement.cpp
index db6a48f..cc6044f 100644
--- a/core/sql/cli/Statement.cpp
+++ b/core/sql/cli/Statement.cpp
@@ -2068,7 +2068,7 @@ RETCODE Statement::doHiveTableSimCheck(TrafSimilarityTableInfo *si,
   if (retcode == 1) // check failed
     {
       char errStr[2000];
-      str_sprintf(errStr, "compiledModTS = %Ld, failedModTS = %Ld, failedLoc = %s", 
+      str_sprintf(errStr, "compiledModTS = %ld, failedModTS = %ld, failedLoc = %s", 
                   si->modTS(), failedModTS, 
                   (failedLocBufLen > 0 ? failedLocBuf : si->hdfsRootDir()));
       

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/clitest/blobtest.cpp
----------------------------------------------------------------------
diff --git a/core/sql/clitest/blobtest.cpp b/core/sql/clitest/blobtest.cpp
index 492bbd6..98c7279 100644
--- a/core/sql/clitest/blobtest.cpp
+++ b/core/sql/clitest/blobtest.cpp
@@ -44,7 +44,7 @@ Int32 extractLengthOfLobColumn(CliGlobals *cliglob, char *lobHandle,
   char lobLengthResult[200];
   str_cpy_all(lobLengthResult," ",200);
   Int32 lobLengthResultLen = 0;
-  str_sprintf(query,"extract loblength (lob '%s') LOCATION %Ld ",lobHandle, &lengthOfLob);
+  str_sprintf(query,"extract loblength (lob '%s') LENGTH %ld ",lobHandle, lengthOfLob);
   retcode = cliInterface.executeImmediate(query,lobLengthResult,&lobLengthResultLen,FALSE);
 
   delete query;
@@ -84,7 +84,7 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
   Int64 lobExtractLen = 10000;
   char *lobDataBuf = new char[lobExtractLen];
   
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, &lobExtractLen);
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %ld, SIZE %ld) ", lobHandle, (Int64)lobDataBuf, lobExtractLen);
  
  
   retcode = cliInterface.executeImmediatePrepare(query);
@@ -107,7 +107,7 @@ Int32 extractLobToBuffer(CliGlobals *cliglob, char * lobHandle, Int64 &lengthOfL
 
       fclose(lobFileId);
     }
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE 0) ", lobHandle, (Int64)lobDataBuf);
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %ld, SIZE 0) ", lobHandle, (Int64)lobDataBuf);
  
   cliInterface.clearExecFetchClose(NULL,NULL,statusBuf, &statusBufLen);
   delete  lobFinalBuf;
@@ -135,7 +135,7 @@ Int32 extractLobToFileInChunks(CliGlobals *cliglob,  char * lobHandle, char *fil
   char *lobDataBuf = new char[lobExtractLen];
   Int64 *inputOutputAddr = &lobExtractLen;
 
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, inputOutputAddr);
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %ld, SIZE %ld) ", lobHandle, (Int64)lobDataBuf, lobExtractLen);
  
  
   retcode = cliInterface.executeImmediatePrepare(query);
@@ -152,7 +152,7 @@ Int32 extractLobToFileInChunks(CliGlobals *cliglob,  char * lobHandle, char *fil
 	}
     }
   lobExtractLen = 0;
-  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %Ld, SIZE %Ld) ", lobHandle, (Int64)lobDataBuf, inputOutputAddr);
+  str_sprintf(query,"extract lobtobuffer(lob '%s', LOCATION %ld, SIZE %ld) ", lobHandle, (Int64)lobDataBuf, lobExtractLen);
   retcode = cliInterface.executeImmediatePrepare(query);
   cliInterface.clearExecFetchClose(NULL,NULL,statusBuf, &statusBufLen);
 
@@ -181,7 +181,7 @@ Int32 insertBufferToLob(CliGlobals *cliglob, char *tableName)
   Int64 lobInsertLen = 10;
   char *lobDataBuf = new char[lobInsertLen];
   memcpy(lobDataBuf, "xxxxxyyyyy",10);
-  str_sprintf(query,"insert into %s values (1, buffertolob (LOCATION %Ld, SIZE %Ld))", tableName,(Int64)lobDataBuf, lobInsertLen);
+  str_sprintf(query,"insert into %s values (1, buffertolob (LOCATION %ld, SIZE %ld))", tableName,(Int64)lobDataBuf, lobInsertLen);
  
  
   retcode = cliInterface.executeImmediate(query);
@@ -217,7 +217,7 @@ Int32 updateBufferToLob(CliGlobals *cliglob, char *tableName, char *columnName)
   Int64 lobUpdateLen = 20;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
-  str_sprintf(query,"update %s set %s= buffertolob(LOCATION %Ld, SIZE %Ld)", tableName,columnName, (Int64)lobDataBuf, lobUpdateLen);
+  str_sprintf(query,"update %s set %s= buffertolob(LOCATION %ld, SIZE %ld)", tableName,columnName, (Int64)lobDataBuf, lobUpdateLen);
  
  
   retcode = cliInterface.executeImmediate(query);
@@ -253,7 +253,7 @@ Int32 updateAppendBufferToLob(CliGlobals *cliglob, char *tableName, char *column
   Int64 lobUpdateLen = 15;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "aaaaabbbbbccccc",15);
-  str_sprintf(query,"update %s set %s=buffertolob (LOCATION %Ld, SIZE %Ld,append)", tableName, columnName,(Int64)lobDataBuf, lobUpdateLen);
+  str_sprintf(query,"update %s set %s=buffertolob (LOCATION %ld, SIZE %ld,append)", tableName, columnName,(Int64)lobDataBuf, lobUpdateLen);
  
  
   retcode = cliInterface.executeImmediate(query);
@@ -288,7 +288,7 @@ Int32 updateBufferToLobHandle(CliGlobals *cliglob,char *handle)
   Int64 lobUpdateLen = 20;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, "zzzzzzzzzzzzzzzzzzzz",20);
-  str_sprintf(query,"update lob (LOB '%s' , LOCATION %Ld, SIZE %Ld)", handle, (Int64)lobDataBuf, lobUpdateLen);
+  str_sprintf(query,"update lob (LOB '%s' , LOCATION %ld, SIZE %ld)", handle, (Int64)lobDataBuf, lobUpdateLen);
  
  
   retcode = cliInterface.executeImmediate(query);
@@ -321,7 +321,7 @@ Int32 updateAppendBufferToLobHandle(CliGlobals *cliglob,char *handle, Int64 lobU
   Int32 statusBufLen = 0;
   char *lobDataBuf = new char[lobUpdateLen];
   memcpy(lobDataBuf, (char *)sourceAddress,lobUpdateLen);
-  str_sprintf(query,"update lob (LOB '%s' , LOCATION %Ld, SIZE %Ld,append )", handle, (Int64)lobDataBuf, lobUpdateLen);
+  str_sprintf(query,"update lob (LOB '%s' , LOCATION %ld, SIZE %ld,append )", handle, (Int64)lobDataBuf, lobUpdateLen);
  
  
   retcode = cliInterface.executeImmediate(query);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdb.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdb.cpp b/core/sql/comexe/ComTdb.cpp
index 5007e01..5696ce4 100644
--- a/core/sql/comexe/ComTdb.cpp
+++ b/core/sql/comexe/ComTdb.cpp
@@ -228,7 +228,7 @@ void ComTdb::displayContents(Space * space,ULng32 flag)
                   estRowsUsed_, estRowsAccessed_, expressionMode_);
   		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-  		str_sprintf(buf, "Flag = %b",flags_);
+  		str_sprintf(buf, "Flag = %x",flags_);
   		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
   		if (firstNRows() >= 0)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbExeUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.cpp b/core/sql/comexe/ComTdbExeUtil.cpp
index b295bc3..35b6112 100644
--- a/core/sql/comexe/ComTdbExeUtil.cpp
+++ b/core/sql/comexe/ComTdbExeUtil.cpp
@@ -786,7 +786,7 @@ void ComTdbExeUtilLoadVolatileTable::displayContents(Space * space,ULng32 flag)
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	}
 
-      str_sprintf(buf,"Threshold = %Ld ", threshold_);
+      str_sprintf(buf,"Threshold = %ld ", threshold_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
     }
@@ -1626,7 +1626,7 @@ void ComTdbExeUtilGetUID::displayContents(Space * space,ULng32 flag)
       str_sprintf(buf, "\nFor ComTdbExeUtilGetUID :");
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       
-      str_sprintf(buf,"UID = %LD", uid_);
+      str_sprintf(buf,"UID = %ld", uid_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     }
   
@@ -1802,7 +1802,7 @@ void ComTdbExeUtilPopulateInMemStats::displayContents(Space * space,ULng32 flag)
       str_sprintf(buf, "\nFor ComTdbExeUtilPopulateInMemStats :");
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       
-      str_sprintf(buf,"UID = %LD", uid_);
+      str_sprintf(buf,"UID = %ld", uid_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       if ((char *)inMemHistogramsTableName_ != (char *)NULL)
@@ -2146,7 +2146,7 @@ void ComTdbExeUtilGetMetadataInfo::displayContents(Space * space,ULng32 flag)
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	}
 
-      str_sprintf(buf, "Flags = %b",flags_);
+      str_sprintf(buf, "Flags = %x",flags_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbExeUtil.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbExeUtil.h b/core/sql/comexe/ComTdbExeUtil.h
index 884a7d9..426622d 100644
--- a/core/sql/comexe/ComTdbExeUtil.h
+++ b/core/sql/comexe/ComTdbExeUtil.h
@@ -1691,7 +1691,7 @@ public:
     return hdfsPort_;
   }
 
-  Lng32 getModTS() const
+  Int64 getModTS() const
   {
     return modTS_;
   }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbFastTransport.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbFastTransport.cpp b/core/sql/comexe/ComTdbFastTransport.cpp
index bca4d32..49d830e 100644
--- a/core/sql/comexe/ComTdbFastTransport.cpp
+++ b/core/sql/comexe/ComTdbFastTransport.cpp
@@ -160,7 +160,7 @@ void ComTdbFastExtract::displayContents(Space *space, ULng32 flag)
 
     Lng32 lowFlags = (Lng32) (flags_ % 65536);
     Lng32 highFlags = (Lng32) ((flags_ - lowFlags) / 65536);
-    str_sprintf(buf, "flags = %b%b", highFlags, lowFlags);
+    str_sprintf(buf, "flags = %x%x", highFlags, lowFlags);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sz);
 
     str_sprintf(buf, "requestRowLength = %d ", requestRowLen_);
@@ -220,7 +220,7 @@ void ComTdbFastExtract::displayContents(Space *space, ULng32 flag)
    str_sprintf(buf,"numIOBuffers = %d", numIOBuffers_);
    space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(UInt16));
 
-   str_sprintf(buf, "modTSforDir_ = %Ld", modTSforDir_);
+   str_sprintf(buf, "modTSforDir_ = %ld", modTSforDir_);
    space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
    
   } // if (flag & 0x00000008)

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbFirstN.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbFirstN.cpp b/core/sql/comexe/ComTdbFirstN.cpp
index 2d752cd..a6050a4 100644
--- a/core/sql/comexe/ComTdbFirstN.cpp
+++ b/core/sql/comexe/ComTdbFirstN.cpp
@@ -113,7 +113,7 @@ void ComTdbFirstN::displayContents(Space * space,ULng32 flag)
       str_sprintf(buf, "\nFor ComTdbFirstN :");
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       
-      str_sprintf(buf,"firstNRows = %d", firstNRows_);
+      str_sprintf(buf,"firstNRows = %ld", firstNRows_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     }
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbHashj.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHashj.cpp b/core/sql/comexe/ComTdbHashj.cpp
index 2c8e2b8..2d3ba8a 100644
--- a/core/sql/comexe/ComTdbHashj.cpp
+++ b/core/sql/comexe/ComTdbHashj.cpp
@@ -329,7 +329,7 @@ void ComTdbHashj::displayContents(Space * space,ULng32 flag)
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       str_sprintf(buf,
-		  "hjFlags = %b, isSemiJoin = %d, isLeftJoin = %d, isRightJoin = %d",
+		  "hjFlags = %x, isSemiJoin = %d, isLeftJoin = %d, isRightJoin = %d",
 		  hjFlags_,isSemiJoin(),isLeftJoin(),isRightJoin());
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbHbaseAccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHbaseAccess.cpp b/core/sql/comexe/ComTdbHbaseAccess.cpp
index 1e81d86..272fba6 100644
--- a/core/sql/comexe/ComTdbHbaseAccess.cpp
+++ b/core/sql/comexe/ComTdbHbaseAccess.cpp
@@ -680,7 +680,7 @@ static void showColNames(Queue * listOfColNames, Space * space)
       else
 	v = 0;
       
-      str_sprintf(buf, "  Entry #%d: %s%s%Ld",
+      str_sprintf(buf, "  Entry #%d: %s%s%ld",
 		  j+1, 
 		  colFam, 
 		  (withAt ? "@" : ""),
@@ -964,7 +964,7 @@ void ComTdbHbaseAccess::displayContents(Space * space,ULng32 flag)
 		  mergeInsertRowLen_, keyLen_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf, "Flag = %b",flags_);
+      str_sprintf(buf, "Flag = %x",flags_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       str_sprintf(buf, "server_ = %s, zkPort_ = %s", server(), zkPort());
@@ -1060,7 +1060,7 @@ void ComTdbHbaseAccess::displayContents(Space * space,ULng32 flag)
 		    } // for
 		} // if colNames
 
-	      str_sprintf(buf, "\n    colTS_=%Ld",
+	      str_sprintf(buf, "\n    colTS_=%ld",
 			  hsr->colTS_);
 	      space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
@@ -1124,7 +1124,7 @@ void ComTdbHbaseAccess::displayContents(Space * space,ULng32 flag)
 		    } // for
 		} // if
 
-	      str_sprintf(buf, "\n    colTS_=%Ld",
+	      str_sprintf(buf, "\n    colTS_=%ld",
 			  hgr->colTS_);
 	      space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHdfsScan.cpp b/core/sql/comexe/ComTdbHdfsScan.cpp
index 6e559fe..a0bf5c1 100755
--- a/core/sql/comexe/ComTdbHdfsScan.cpp
+++ b/core/sql/comexe/ComTdbHdfsScan.cpp
@@ -228,8 +228,8 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
                          recordDelimiter_ ,  columnDelimiter_ );
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf, "hdfsBufSize_ = %d, rangeTailIOSize_ = %d, "
-                       "hdfsSqlMaxRecLen_ = %d",
+      str_sprintf(buf, "hdfsBufSize_ = %ld, rangeTailIOSize_ = %d, "
+                       "hdfsSqlMaxRecLen_ = %ld",
                         hdfsBufSize_ ,  rangeTailIOSize_, hdfsSqlMaxRecLen_ );
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
@@ -237,11 +237,11 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
                           tuppIndex_ ,      workAtpIndex_ );
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf, "asciiTuppIndex_ = %d, asciiRowLen_ = %d",
+      str_sprintf(buf, "asciiTuppIndex_ = %d, asciiRowLen_ = %ld",
                           asciiTuppIndex_ ,      asciiRowLen_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf, "moveExprColsTuppIndex_ = %d, moveExprColsRowLength_ = %d",
+      str_sprintf(buf, "moveExprColsTuppIndex_ = %d, moveExprColsRowLength_ = %ld",
                           moveExprColsTuppIndex_ ,      moveExprColsRowLength_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
@@ -253,10 +253,10 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
           space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
         }
 
-      str_sprintf(buf, "outputRowLength_ = %d", outputRowLength_);
+      str_sprintf(buf, "outputRowLength_ = %ld", outputRowLength_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf, "Flag = %b",flags_);
+      str_sprintf(buf, "Flag = %x",flags_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       Queue *hdfsFileInfoList = hdfsFileInfoList_;
@@ -411,7 +411,7 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
 
               str_sprintf(
                    buf, 
-		   "%6d %6d %12Ld %12Ld  %s %s",
+		   "%6d %6d %12ld %12ld  %s %s",
                    currInstNum,
                    currEntryNum,
                    hdfo->getStartOffset(),
@@ -426,7 +426,7 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
               currEntryNum++;
             }
 
-          str_sprintf(buf, "\nSummary of bytes read per ESP (%Ld = 100 percent):\n",
+          str_sprintf(buf, "\nSummary of bytes read per ESP (%ld = 100 percent):\n",
                       totalBytes);
           space->allocateAndCopyToAlignedSpace(buf, str_len(buf),
                                                sizeof(short));
@@ -438,7 +438,7 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
 
           for (Int32 e=0; e<numESPs; e++)
             {
-              str_sprintf(buf,"ESP %4d reads %18Ld bytes (%4d percent of avg)",
+              str_sprintf(buf,"ESP %4d reads %18ld bytes (%4ld percent of avg)",
                           e,
                           bytesPerESP[e],
                           (Int32) 100 * bytesPerESP[e] * numESPs / totalBytes);
@@ -449,10 +449,10 @@ void ComTdbHdfsScan::displayContents(Space * space,ULng32 flag)
 
       if (hdfsRootDir_)
         {
-          str_sprintf(buf, "hdfsRootDir: %s", hdfsRootDir_);
+          str_sprintf(buf, "hdfsRootDir: %s", hdfsRootDir());
           space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-          str_sprintf(buf, "modTSforDir_ = %Ld, numOfPartCols_ = %d",
+          str_sprintf(buf, "modTSforDir_ = %ld, numOfPartCols_ = %d",
                       modTSforDir_, numOfPartCols_);
           space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbHdfsScan.h
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbHdfsScan.h b/core/sql/comexe/ComTdbHdfsScan.h
index 9628d06..1d65bca 100755
--- a/core/sql/comexe/ComTdbHdfsScan.h
+++ b/core/sql/comexe/ComTdbHdfsScan.h
@@ -349,6 +349,8 @@ public:
   }
 
   Queue * hdfsDirsToCheck() { return hdfsDirsToCheck_; }
+ 
+  char *hdfsRootDir() { return hdfsRootDir_; }
 };
 
 inline ComTdb * ComTdbHdfsScan::getChildTdb()

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbMj.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbMj.cpp b/core/sql/comexe/ComTdbMj.cpp
index 81f93b8..6be4d5d 100644
--- a/core/sql/comexe/ComTdbMj.cpp
+++ b/core/sql/comexe/ComTdbMj.cpp
@@ -189,7 +189,7 @@ void ComTdbMj::displayContents(Space * space,ULng32 flag)
   if (flag & 0x00000008)
     {
       char buf[100];
-      str_sprintf(buf, "\nFor ComTdbMj :\nFlags = %b, ljRecLen = %d, rightDupRecLen = %d ",
+      str_sprintf(buf, "\nFor ComTdbMj :\nFlags = %x, ljRecLen = %d, rightDupRecLen = %d ",
 		  flags_, ljRecLen_, rightDupRecLen_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbOnlj.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbOnlj.cpp b/core/sql/comexe/ComTdbOnlj.cpp
index 9fa2d44..d747f6a 100644
--- a/core/sql/comexe/ComTdbOnlj.cpp
+++ b/core/sql/comexe/ComTdbOnlj.cpp
@@ -220,7 +220,7 @@ void ComTdbOnlj::displayContents(Space * space,ULng32 flag)
       if(flag & 0x00000008)
         {
 		      char buf[100];
-	   		str_sprintf(buf, "\nFor ComTdbOnlj :\nFlags = %b, ljRecLen = %d, instantiatedRowAtpIndex = %d ",
+	   		str_sprintf(buf, "\nFor ComTdbOnlj :\nFlags = %x, ljRecLen = %d, instantiatedRowAtpIndex = %d ",
       						flags_, ljRecLen_, instantiatedRowAtpIndex_);
 		      space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbProbeCache.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbProbeCache.cpp b/core/sql/comexe/ComTdbProbeCache.cpp
index e9bee80..2bc0e41 100644
--- a/core/sql/comexe/ComTdbProbeCache.cpp
+++ b/core/sql/comexe/ComTdbProbeCache.cpp
@@ -118,7 +118,7 @@ void ComTdbProbeCache::displayContents(Space * space,ULng32 flag)
         probeLen_,      cacheSize_,      recLen_,      tuppIndex_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       str_sprintf(buf, 
-       "probeCacheFlags_ = %b, numInnerTuples_ =%d", 
+       "probeCacheFlags_ = %x, numInnerTuples_ =%d", 
         probeCacheFlags_,      numInnerTuples_ );
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbRoot.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbRoot.cpp b/core/sql/comexe/ComTdbRoot.cpp
index c77471e..6c0d6cf 100644
--- a/core/sql/comexe/ComTdbRoot.cpp
+++ b/core/sql/comexe/ComTdbRoot.cpp
@@ -442,7 +442,7 @@ void ComTdbRoot::displayContents(Space * space,ULng32 flag)
   if(flag & 0x00000008)
     {
       char buf[1000];
-      str_sprintf(buf, "\nFor ComTdbRoot :\nFirstNRows = %d, baseTablenamePosition = %d ",
+      str_sprintf(buf, "\nFor ComTdbRoot :\nFirstNRows = %ld, baseTablenamePosition = %d ",
 		  firstNRows_,baseTablenamePosition_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       str_sprintf(buf, "queryType_ = %d, planVersion_ = %d ",
@@ -451,25 +451,25 @@ void ComTdbRoot::displayContents(Space * space,ULng32 flag)
       
       UInt32 lFlags = rtFlags1_%65536;
       UInt32 hFlags = (rtFlags1_- lFlags)/65536;
-      str_sprintf(buf,"rtFlags1_ = %b%b ",hFlags,lFlags);
+      str_sprintf(buf,"rtFlags1_ = %x%x ",hFlags,lFlags);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       lFlags = rtFlags2_%65536;
       hFlags = (rtFlags2_- lFlags)/65536;
-      str_sprintf(buf,"rtFlags2_ = %b%b ",hFlags,lFlags);
+      str_sprintf(buf,"rtFlags2_ = %x%x ",hFlags,lFlags);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-      str_sprintf(buf,"rtFlags3_ = %b ", rtFlags3_);
+      str_sprintf(buf,"rtFlags3_ = %x ", rtFlags3_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       lFlags = rtFlags4_%65536;
       hFlags = (rtFlags4_- lFlags)/65536;
-      str_sprintf(buf,"rtFlags4_ = %b%b ",hFlags,lFlags);
+      str_sprintf(buf,"rtFlags4_ = %x%x ",hFlags,lFlags);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       lFlags = rtFlags5_%65536;
       hFlags = (rtFlags5_- lFlags)/65536;
-      str_sprintf(buf,"rtFlags5_ = %b%b ",hFlags,lFlags);
+      str_sprintf(buf,"rtFlags5_ = %x%x ",hFlags,lFlags);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
       str_sprintf(buf, "queryType_ = %d", (Int32) queryType_);
@@ -486,7 +486,7 @@ void ComTdbRoot::displayContents(Space * space,ULng32 flag)
 
       if (compoundStmtsInfo_ != 0)
 	{
-	  str_sprintf(buf,"compoundStmtsInfo_ = %b ",compoundStmtsInfo_);
+	  str_sprintf(buf,"compoundStmtsInfo_ = %x ",compoundStmtsInfo_);
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	}
 
@@ -540,7 +540,7 @@ void ComTdbRoot::displayContents(Space * space,ULng32 flag)
 		      getRWRSInfo()->rwrsMaxInternalRowlen_);
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	  
-	  str_sprintf(buf,"flags_ = %b ", getRWRSInfo()->flags_);
+	  str_sprintf(buf,"flags_ = %x ", getRWRSInfo()->flags_);
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSendBottom.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSendBottom.cpp b/core/sql/comexe/ComTdbSendBottom.cpp
index f63ef85..1e2ebbd 100644
--- a/core/sql/comexe/ComTdbSendBottom.cpp
+++ b/core/sql/comexe/ComTdbSendBottom.cpp
@@ -152,7 +152,7 @@ void ComTdbSendBottom::displayContents(Space *space, ULng32 flag)
     str_sprintf(buf, "\nFor ComTdbSendBottom :");
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     
-    str_sprintf(buf, "sendBottomFlags_ = %b", (Lng32) sendBottomFlags_);
+    str_sprintf(buf, "sendBottomFlags_ = %x", (Lng32) sendBottomFlags_);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
     str_sprintf(buf, "downRecordLength_ = %d, upRecordLength_ = %d",

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSendTop.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSendTop.cpp b/core/sql/comexe/ComTdbSendTop.cpp
index 67f3b94..5508832 100644
--- a/core/sql/comexe/ComTdbSendTop.cpp
+++ b/core/sql/comexe/ComTdbSendTop.cpp
@@ -206,7 +206,7 @@ void ComTdbSendTop::displayContents(Space *space, ULng32 flag)
     str_sprintf(buf, "\nFor ComTdbSendTop :");
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     
-    str_sprintf(buf, "childFragId_ = %d, sendTopFlags_ = %b",
+    str_sprintf(buf, "childFragId_ = %d, sendTopFlags_ = %x",
                 (Lng32) childFragId_, (Lng32) sendTopFlags_);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSequence.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSequence.cpp b/core/sql/comexe/ComTdbSequence.cpp
index 37b4d89..7f727a1 100644
--- a/core/sql/comexe/ComTdbSequence.cpp
+++ b/core/sql/comexe/ComTdbSequence.cpp
@@ -146,7 +146,7 @@ void ComTdbSequence::displayContents(Space * space,ULng32 flag)
       str_sprintf(buf, "\nFor ComTdbSequence :");
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
       
-      str_sprintf(buf,"recLen_ = %d, maxHistoryRows_ = %d, OLAPFlags_ = %b %s",
+      str_sprintf(buf,"recLen_ = %d, maxHistoryRows_ = %d, OLAPFlags_ = %x %s",
 		  recLen_, maxHistoryRows_, OLAPFlags_,
 		  isUnboundedFollowing() ? ", UNBOUNDED_FOLLOWING" : "");
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSort.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSort.cpp b/core/sql/comexe/ComTdbSort.cpp
index 4ca4e45..72763b2 100644
--- a/core/sql/comexe/ComTdbSort.cpp
+++ b/core/sql/comexe/ComTdbSort.cpp
@@ -136,7 +136,7 @@ void ComTdbSort::displayContents(Space * space,ULng32 flag)
             space->allocateAndCopyToAlignedSpace(buf, str_len(buf),
                                                     sizeof(short));
 
-            str_sprintf(buf,"Flags = %b, sortRecLen = %d, sortKeyLen = %d",
+            str_sprintf(buf,"Flags = %x, sortRecLen = %d, sortKeyLen = %d",
 		      	  flags_,sortRecLen_,sortKeyLen_);
             space->allocateAndCopyToAlignedSpace(buf, str_len(buf),
                                                     sizeof(short));
@@ -180,7 +180,7 @@ void SortOptions::displayContents(Space *space)
    							sortNRows_,sortType_,internalSort_);
    space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
-   str_sprintf(buf,"Sort Option Flags = %b", flags_);
+   str_sprintf(buf,"Sort Option Flags = %x", flags_);
    space->allocateAndCopyToAlignedSpace(buf, str_len(buf),sizeof(short));
    
    str_sprintf(buf, "sortMaxHeapSizeMB = %d, scratchFreeSpaceThreshold = %d",

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSortGrby.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSortGrby.cpp b/core/sql/comexe/ComTdbSortGrby.cpp
index f3932d1..aa6204d 100644
--- a/core/sql/comexe/ComTdbSortGrby.cpp
+++ b/core/sql/comexe/ComTdbSortGrby.cpp
@@ -126,7 +126,7 @@ void ComTdbSortGrby::displayContents(Space * space,ULng32 flag)
       if(flag & 0x00000008)
         {
 	  			char buf[100];
-			   str_sprintf(buf, "\nFor ComTdbSortGrby :\nFlags = %b, recLen = %d ",flags_,recLen_ );
+			   str_sprintf(buf, "\nFor ComTdbSortGrby :\nFlags = %x, recLen = %d ",flags_,recLen_ );
       		space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSplitBottom.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSplitBottom.cpp b/core/sql/comexe/ComTdbSplitBottom.cpp
index a7ed2b1..1123360 100644
--- a/core/sql/comexe/ComTdbSplitBottom.cpp
+++ b/core/sql/comexe/ComTdbSplitBottom.cpp
@@ -176,7 +176,7 @@ void ComTdbSplitBottom::displayContents(Space * space,ULng32 flag)
     str_sprintf(buf, "\nFor ComTdbSplitBottom :");
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     
-    str_sprintf(buf, "splitBottomFlags_ = %b", (Lng32) splitBottomFlags_);
+    str_sprintf(buf, "splitBottomFlags_ = %x", (Lng32) splitBottomFlags_);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     
     str_sprintf(buf, "topNumESPs = %d, bottomNumESPs = %d", 
@@ -222,7 +222,7 @@ void ComTdbSplitBottom::displayContents(Space * space,ULng32 flag)
       
       while (numTriads > 0)
       {
-        str_sprintf(buf, "%23Ld %23Ld %23Ld", 
+        str_sprintf(buf, "%23ld %23ld %23ld", 
                     skewInfo_->getSkewHashValues()[i],
                     skewInfo_->getSkewHashValues()[i+1],
                     skewInfo_->getSkewHashValues()[i+2]);
@@ -235,7 +235,7 @@ void ComTdbSplitBottom::displayContents(Space * space,ULng32 flag)
       // Now do the final line: 1 or 2 values.
       if (numLeftovers == 2)
       {
-        str_sprintf(buf, "%23Ld %23Ld", 
+        str_sprintf(buf, "%23ld %23ld", 
                     skewInfo_->getSkewHashValues()[i],
                     skewInfo_->getSkewHashValues()[i+1]);
         space->allocateAndCopyToAlignedSpace(buf, str_len(buf), 
@@ -243,7 +243,7 @@ void ComTdbSplitBottom::displayContents(Space * space,ULng32 flag)
       }
       else if (numLeftovers == 1)
       {
-        str_sprintf(buf, "%23Ld", 
+        str_sprintf(buf, "%23ld", 
                     skewInfo_->getSkewHashValues()[i]);
         space->allocateAndCopyToAlignedSpace(buf, str_len(buf), 
                                              sizeof(short));

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbSplitTop.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbSplitTop.cpp b/core/sql/comexe/ComTdbSplitTop.cpp
index 730b67a..b29433f 100644
--- a/core/sql/comexe/ComTdbSplitTop.cpp
+++ b/core/sql/comexe/ComTdbSplitTop.cpp
@@ -177,10 +177,10 @@ void ComTdbSplitTop::displayContents(Space *space, ULng32 flag)
   {
     char buf[256];
     
-    str_sprintf(buf, "\nFor ComTdbSplitTop :\nFlags = %b ",flags_);
+    str_sprintf(buf, "\nFor ComTdbSplitTop :\nFlags = %x ",flags_);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     
-    str_sprintf(buf, "splitTopFlags_ = %b", (Lng32) splitTopFlags_);
+    str_sprintf(buf, "splitTopFlags_ = %x", (Lng32) splitTopFlags_);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 
     str_sprintf(buf, "bottomNumParts_ = %d", (Int32) bottomNumParts_);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbTupleFlow.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbTupleFlow.cpp b/core/sql/comexe/ComTdbTupleFlow.cpp
index 42641f9..d0120f5 100644
--- a/core/sql/comexe/ComTdbTupleFlow.cpp
+++ b/core/sql/comexe/ComTdbTupleFlow.cpp
@@ -141,7 +141,7 @@ void ComTdbTupleFlow::displayContents(Space * space,ULng32 flag)
 #pragma nowarn(1506)   // warning elimination 
 		      Lng32 hFlags = (flags_- lFlags)/65536;
 #pragma warn(1506)  // warning elimination 
- 	   		str_sprintf(buf, "\nFor ComTdbTupleFlow :\nFlags = %b%b ",hFlags,lFlags );
+ 	   		str_sprintf(buf, "\nFor ComTdbTupleFlow :\nFlags = %x%x ",hFlags,lFlags );
 		      space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbUdr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbUdr.cpp b/core/sql/comexe/ComTdbUdr.cpp
index d602de0..e3b79f0 100644
--- a/core/sql/comexe/ComTdbUdr.cpp
+++ b/core/sql/comexe/ComTdbUdr.cpp
@@ -269,7 +269,7 @@ void ComTdbUdr::displayContents(Space *space, ULng32 flag)
 
     Lng32 lowFlags = (Lng32) (flags_ % 65536);
     Lng32 highFlags = (Lng32) ((flags_ - lowFlags) / 65536);
-    str_sprintf(buf, "flags = %b%b", highFlags, lowFlags);
+    str_sprintf(buf, "flags = %x%x", highFlags, lowFlags);
     space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sz);
 
     if (sqlName_)
@@ -393,7 +393,7 @@ void ComTdbUdr::displayContents(Space *space, ULng32 flag)
       str_sprintf(buf, "  name [%s]", p->getParamName());
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sz);
 
-      str_sprintf(buf, "  flags %b, type %d", p->getFlags(),
+      str_sprintf(buf, "  flags %x, type %d", p->getFlags(),
                   (Int32) p->getType());
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sz);
 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbUnPackRows.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbUnPackRows.cpp b/core/sql/comexe/ComTdbUnPackRows.cpp
index c2218fe..fe49efa 100644
--- a/core/sql/comexe/ComTdbUnPackRows.cpp
+++ b/core/sql/comexe/ComTdbUnPackRows.cpp
@@ -298,7 +298,7 @@ void ComTdbUnPackRows::displayContents(Space * space,ULng32 flag)
 	  space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
 	}
 
-      str_sprintf(buf,"flags_ = %b", flags_);
+      str_sprintf(buf,"flags_ = %x", flags_);
       space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
     }
   

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/comexe/ComTdbUnion.cpp
----------------------------------------------------------------------
diff --git a/core/sql/comexe/ComTdbUnion.cpp b/core/sql/comexe/ComTdbUnion.cpp
index 8b123c8..490afb6 100644
--- a/core/sql/comexe/ComTdbUnion.cpp
+++ b/core/sql/comexe/ComTdbUnion.cpp
@@ -232,7 +232,7 @@ void ComTdbUnion::displayContents(Space * space,ULng32 flag)
       if(flag & 0x00000008)
         {
 		      char buf[100];
-	   		str_sprintf(buf, "\nFor ComTdbUnion :\nFlags = %b, unionReclen = %d ",
+	   		str_sprintf(buf, "\nFor ComTdbUnion :\nFlags = %x, unionReclen = %d ",
       						flags_,unionReclen_);
 		      space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
         }

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/common/ComSqlId.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/ComSqlId.cpp b/core/sql/common/ComSqlId.cpp
index 9be694b..881a2bc 100644
--- a/core/sql/common/ComSqlId.cpp
+++ b/core/sql/common/ComSqlId.cpp
@@ -65,7 +65,7 @@ Lng32 ComSqlId::createSqlSessionId
   // The format of current session id is:
   //  MXID<version><segment><cpu><pin><processStartTS><sessNum><unLen><userName><snLen><sessionName>
   str_sprintf
-    (sessionId, "%s%02d%03d%06d%018Ld%010d%02d%s%02d%s",
+    (sessionId, "%s%02d%03d%06d%018ld%010d%02d%s%02d%s",
      COM_SESSION_ID_PREFIX,
      SQ_SQL_ID_VERSION,
      nodeNumber,                      // 3 digits
@@ -105,7 +105,7 @@ Lng32 ComSqlId::createSqlQueryId
   // number of digits delimited by underscores. 
   // Ex, queryNum of 12 will be store as _12_
   //
-  str_sprintf(queryId, "%s_%Ld_",
+  str_sprintf(queryId, "%s_%ld_",
 	      sessionId,
 	      queryUniqueNum
 	      );

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/common/ComViewColUsage.h
----------------------------------------------------------------------
diff --git a/core/sql/common/ComViewColUsage.h b/core/sql/common/ComViewColUsage.h
index 1ec12c6..0f62e9e 100644
--- a/core/sql/common/ComViewColUsage.h
+++ b/core/sql/common/ComViewColUsage.h
@@ -91,7 +91,7 @@ public:
       // usage contains 2 int64 and 3 int32, 200 chars is big enough to hold 
       // the string representation
       char buf[200];
-      str_sprintf(buf, "viewUID: %Ld viewCol: %d refUID: %Ld refCol: %d refType: %d;",
+      str_sprintf(buf, "viewUID: %ld viewCol: %d refUID: %ld refCol: %d refType: %d;",
                   viewUID_, viewColNumber_,
                   refdUID_, refdColNumber_, refdObjectType_);
       viewColUsageStr = buf;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/common/IpcGuardian.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/IpcGuardian.cpp b/core/sql/common/IpcGuardian.cpp
index 89e968f..9cb4284 100644
--- a/core/sql/common/IpcGuardian.cpp
+++ b/core/sql/common/IpcGuardian.cpp
@@ -965,7 +965,7 @@ void GuaConnectionToServer::openRetryCleanup()
        , seqNum
        );
     str_sprintf(msgBuf,
-      "GuaConnectionToServer: BFILE_OPEN %d,%d,%Ld "
+      "GuaConnectionToServer: BFILE_OPEN %d,%d,%ld "
       "error 14 retry count = %d\n", cpu, pin, seqNum, getOpenRetries());
     SQLMXLoggingArea::logExecRtInfo(__FILE__, __LINE__, msgBuf, 0);
      setOpenRetries(0);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/common/str.cpp
----------------------------------------------------------------------
diff --git a/core/sql/common/str.cpp b/core/sql/common/str.cpp
index bcb9d36..41a5a0b 100644
--- a/core/sql/common/str.cpp
+++ b/core/sql/common/str.cpp
@@ -517,297 +517,6 @@ void str_complement(const ULng32 length, char * s)
 #pragma warn(1506)  // warning elimination
 }
 
-Int32 str_sprintf(char * buffer, const char * format, ...)
-{
-  va_list ap;
-  va_start(ap, format);
-
-  enum State {INITIAL, PERC_SEEN, NUMBER_SEEN,
-//NA_LINUX	      PERC_PERC, PERC_D, PERC_D64, PERC_S, PERC_F, PERC_B, ERROR};
-	      PERC_PERC, PERC_D, PERC_D64, PERC_S, PERC_F, PERC_B, PERC_ERROR};
-
-  State state = INITIAL;
-
-  Lng32 formatLen = str_len(format);
-  Int32 i = 0;
-  Int32 j = 0;
-  Lng32 width = -1;
-  NABoolean zeroPad = FALSE;
-  NABoolean leadingMinusSeen = FALSE;
-  Int64 d = 0; // used for "f" and "Ld" formats
-
-  while (i < formatLen)
-    {
-      switch (state)
-	{
-	case INITIAL:
-	  {
-	    if (format[i] == '%')
-	      state = PERC_SEEN;
-	    else
-	      {
-		buffer[j] = format[i];
-		j++;
-	      }
-	    i++;
-	  }
-	break;
-
-	case NUMBER_SEEN:
-	  {
-	    if ((format[i] >= '0') && (format[i] <= '9'))
-	      {
-		width = width*10 + format[i] - '0';
-		i++;
-	      }
-	    else
-	      state = PERC_SEEN;
-	  }
-	break;
-
-	case PERC_SEEN:
-	  {
-	    if (format[i] == '%')
-	      state = PERC_PERC;
-	    else if ((format[i] == 'd') || (format[i] == 'u'))
-	      state = PERC_D;
-	    else if ((format[i] == 'L') && (format[i+1] == 'd'))
-	      state = PERC_D64;
-	    else if (format[i] == 's')
-	      state = PERC_S;
-	    else if (format[i] == 'b')
-	      state = PERC_B;
-	    else if (format[i] == 'f')
-	      state = PERC_F;
-	    else if (format[i] == '-')
-	      {
-		leadingMinusSeen = TRUE;
-		state = PERC_SEEN;
-		i++;
-	      }
-	    else if (format[i] >= '0' && format[i] <= '9')
-	      {
-		state = NUMBER_SEEN;
-		width = 0;
-
-		if (format[i] == '0')
-		  zeroPad = TRUE;
-		else
-		  zeroPad = FALSE;
-	      }
-	    else
-	      state = PERC_ERROR;
-	  }
-	break;
-
-	case PERC_PERC:
-	  {
-	    buffer[j] = format[i];
-	    j++;
-	    i++;
-	    state = INITIAL;
-	  }
-	break;
-
-	case PERC_D:
-	  {
-	    Lng32 d = va_arg(ap, Lng32);
-            NABoolean maxNegative = (d == 0x80000000); // i.e. -2147483648
-	    if (d < 0)
-	      {
-		buffer[j] = '-';
-		j++;
-                if (!maxNegative) // guard against trap on negation
-		  d = -d;
-                width--;
-	      }
-
-	    if (width > 0)
-	      {
-		char temp[20];
-                if (maxNegative)
-                  {
-                    strcpy(temp,"2147483648");
-                  }
-                else
-                  {
-	            str_itoa(d, temp);
-                  }
-		if (zeroPad)
-		  str_pad(&buffer[j], width, '0');
-		else
-		  str_pad(&buffer[j], width, ' ');
-	 Int32 l = str_len(temp);
-
-		// truncate string if l is greater than width
-                if (l > width)
-		  { l = width; }
-		if ((leadingMinusSeen) && (NOT zeroPad))// left align
-		  str_cpy_all(&buffer[j], temp, l);
-		else
-		  str_cpy_all(&buffer[j+(width-l)], temp, l);
-		buffer[j+width] = 0;
-		width = 0;
-		zeroPad = FALSE;
-	      }
-	    else
-              {
-              if (maxNegative)
-                {
-                  strcpy(&buffer[j],"2147483648");
-                }
-              else
-                {
-	          str_itoa(d, &buffer[j]);
-                }
-              }
-	    j = str_len(buffer);
-	    i++;
-	    state = INITIAL;
-	  }
-	break;
-
-	case PERC_F:
-	  {
-	    double dd = va_arg(ap, double);
-
-	    if (dd > LLONG_MAX)
-	      d = LLONG_MAX;
-	    else if (dd < LLONG_MIN)
-	      d = LLONG_MIN;
-	    else
-	      d = (Int64) dd;
-	  }
-	// fall through to the next case
-
-	case PERC_D64:
-	  {
-	    if (state == PERC_D64)
-              {
-	        d = va_arg(ap, Int64);
-                i++; // 2 format characters, "Ld"
-              }
-	    const Int32 tempStrW = 20;
-	    char      temp[tempStrW];
-	    Int32       numDigits=0;
-	    if (d < 0)
-	      {
-		buffer[j] = '-';
-		j++;
-		d = -d;
-                width--;
-	      }
-
-	    // convert argument to a string, right-aligned in temp array
-	    do
-	      {
-#pragma nowarn(1506)   // warning elimination
-		temp[tempStrW - 1 - numDigits] = (char) (d % 10) + '0';
-#pragma warn(1506)  // warning elimination
-		d = d / 10;
-		numDigits++;
-	      }
-	    while (d != 0);
-
-	    // handle limited width strings (unlike printf which treats
-	    // the width argument as a minimum length we treat it as
-	    // the exact length here)
-	    if (width > 0)
-	      {
-		if (numDigits > width)
-		  {
-		    // print overflow characters (unlike printf)
-		    str_pad(&buffer[j], width, '*');
-		    numDigits = 0;
-		  }
-		else
-		  {
-		    if (zeroPad)
-		      str_pad(&buffer[j], width-numDigits, '0');
-		    else
-		      str_pad(&buffer[j], width-numDigits, ' ');
-		    j += width-numDigits;
-		  }
-		width = 0;
-		zeroPad = FALSE;
-	      }
-
-	    str_cpy_all(&buffer[j], &temp[tempStrW-numDigits], numDigits);
-	    j += numDigits;
-	    buffer[j] = 0;
-	    i++;
-	    state = INITIAL;
-	  }
-	break;
-
-	case PERC_S:
-	  {
-	    char * s = va_arg(ap, char *);
-	    Lng32 len = str_len(s);
-
-	    if ((leadingMinusSeen) && 
-		(width > len)) // means blankpad to the left
-	      {
-		str_pad(&buffer[j], width-len, ' ');
-		j += (width - len);
-	      }
-	    str_cpy_all(&buffer[j], s, len);
-	    j = j + len;
-	    if ((NOT leadingMinusSeen) && (width > len))
-	      {
-		str_pad(&buffer[j], width-len, ' ');
-		j += (width - len);
-	      }
-
-	    buffer[j] = 0;
-	    i++;
-	    state = INITIAL;
-	  }
-	break;
-
-	case PERC_B:
-	  {
-	    Lng32 d = va_arg(ap, Lng32);
-	    char tempbuf[17];
-	    for(Int32 k=16;k>0;k--)
-	      {
-		if(d == 0)
-		  {
-		    tempbuf[k-1] = '0';
-		    continue;
-		  }
-		if(d%2)
-		  tempbuf[k-1] = '1';
-		else
-		  tempbuf[k-1] = '0';
-		d = d/2;
-	      }
-	    tempbuf[16] = '\0';
-	    str_cpy_all(&buffer[j],tempbuf,str_len(tempbuf));
-	    j = j + str_len(tempbuf);
-	    i++;
-	    state = INITIAL;
-	  }
-	break;
-
-	case PERC_ERROR:
-	  {
-	    //LCOV_EXCL_START :rfi
-	    assert(0);
-	    return -1;
-	    //LCOV_EXCL_STOP
-	  }
-	break;
-
-	} // switch
-
-    }
-
-  buffer[j] = 0;
-
-  return 0;
-}
-
 // ----------------------------------------------------------------------
 // How many bytes are needed to encode byteLen bytes in ASCII?
 // -----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/common/str.h
----------------------------------------------------------------------
diff --git a/core/sql/common/str.h b/core/sql/common/str.h
index ce8db9a..d6bfab0 100644
--- a/core/sql/common/str.h
+++ b/core/sql/common/str.h
@@ -310,6 +310,7 @@ void str_complement(const ULng32 length, char * s);
 // of sprintf as we cannot call C runtime from the SQL executor.
 //------------------------------------------------------------------------
 
+#define str_sprintf sprintf
 Int32 str_sprintf(char *, const char *, ...);
 
 // -----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExExeUtilExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilExplain.cpp b/core/sql/executor/ExExeUtilExplain.cpp
index f9ccf73..12107e5 100644
--- a/core/sql/executor/ExExeUtilExplain.cpp
+++ b/core/sql/executor/ExExeUtilExplain.cpp
@@ -1882,7 +1882,7 @@ void ExExeUtilDisplayExplainTcb::DoHeader()
   FormatLongLine("STATEMENT_NAME", statementName_, 14, valSize);
   
   //convert the Int64 to string
-  str_sprintf(outStr, "%Ld", planId_);
+  str_sprintf(outStr, "%ld", planId_);
   FormatLine("PLAN_ID", outStr, 7, (Lng32)str_len(outStr));
   
   // rework cardinality as rows out.  Assume probe count is always 1

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExExeUtilGet.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilGet.cpp b/core/sql/executor/ExExeUtilGet.cpp
index b32a35a..f0a8e1c 100644
--- a/core/sql/executor/ExExeUtilGet.cpp
+++ b/core/sql/executor/ExExeUtilGet.cpp
@@ -1721,11 +1721,11 @@ short ExExeUtilGetMetadataInfoTcb::work()
             NAString userQuery;
 
 	    char ausStr[1000];
-	    str_sprintf(ausStr, "");
+            ausStr[0] = '\0';
 	    char catSchValue[ComMAX_2_PART_EXTERNAL_UTF8_NAME_LEN_IN_BYTES+50];
-	    str_sprintf(catSchValue, "");
+            catSchValue[0] = '\0';
 	    char endQuote[10];
-	    str_sprintf(endQuote, "");
+            endQuote[0] = '\0';
 
 	    if (getMItdb().returnFullyQualNames())
 	      {
@@ -3013,7 +3013,7 @@ short ExExeUtilGetMetadataInfoComplexTcb::work()
 
 	case SETUP_QUERY_:
 	  {
-	    str_sprintf(patternStr_, "");
+	    patternStr_[0] = '\0';
 	    if (getMItdb().getPattern())
 	      {
 		str_sprintf(patternStr_, ", match '%s' ",
@@ -3844,9 +3844,8 @@ short ExExeUtilGetMetadataInfoVersionTcb::work()
 	    Int32 sizeOfqs = 0;
 
 	    char predStr[2000];
-	    str_sprintf(predStr, "");
-
-	    str_sprintf(patternStr_, "");
+            predStr[0] = '\0';
+            patternStr_[0] = '\0';
 	    if (getMItdb().getPattern())
 	      {
 		str_sprintf(patternStr_, ", match '%s' ",
@@ -6664,23 +6663,23 @@ short ExExeUtilRegionStatsFormatTcb::work()
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  TotalUncompressedSize:   %Ld", statsTotals_->storeFileUncompSize);
+            str_sprintf(buf, "  TotalUncompressedSize:   %ld", statsTotals_->storeFileUncompSize);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-           str_sprintf(buf, "  TotalStoreFileSize:      %Ld", statsTotals_->storeFileSize);
+           str_sprintf(buf, "  TotalStoreFileSize:      %ld", statsTotals_->storeFileSize);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  TotalMemStoreSize:       %Ld", statsTotals_->memStoreSize);
+            str_sprintf(buf, "  TotalMemStoreSize:       %ld", statsTotals_->memStoreSize);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  TotalReadRequestsCount:  %Ld", statsTotals_->readRequestsCount);
+            str_sprintf(buf, "  TotalReadRequestsCount:  %ld", statsTotals_->readRequestsCount);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  TotalWriteRequestsCount: %Ld", statsTotals_->writeRequestsCount);
+            str_sprintf(buf, "  TotalWriteRequestsCount: %ld", statsTotals_->writeRequestsCount);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
@@ -6773,7 +6772,7 @@ short ExExeUtilRegionStatsFormatTcb::work()
 	    short rc = 0;
 
             str_sprintf(buf, "  RegionServer:       %s", 
-                        removeTrailingBlanks(stats_->regionServer, STATS_NAME_MAX_LEN).data(), TRUE);
+                        removeTrailingBlanks(stats_->regionServer, STATS_NAME_MAX_LEN).data());
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
   
@@ -6782,7 +6781,7 @@ short ExExeUtilRegionStatsFormatTcb::work()
 	      return rc;
 
             str_sprintf(buf, "  RegionName:         %s", 
-                        removeTrailingBlanks(stats_->regionName, STATS_REGION_NAME_MAX_LEN).data(), TRUE);
+                        removeTrailingBlanks(stats_->regionName, STATS_REGION_NAME_MAX_LEN).data());
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
             
@@ -6795,31 +6794,31 @@ short ExExeUtilRegionStatsFormatTcb::work()
 	      return rc;
 
             if (stats_->storeFileUncompSize == 0)
-              str_sprintf(buf, "  UncompressedSize:   %Ld (less than 1MB)", stats_->storeFileUncompSize);
+              str_sprintf(buf, "  UncompressedSize:   %ld (less than 1MB)", stats_->storeFileUncompSize);
             else
-              str_sprintf(buf, "  UncompressedSize:   %Ld Bytes", stats_->storeFileUncompSize);
+              str_sprintf(buf, "  UncompressedSize:   %ld Bytes", stats_->storeFileUncompSize);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
             if (stats_->storeFileSize == 0)
-              str_sprintf(buf, "  StoreFileSize:      %Ld (less than 1MB)", stats_->storeFileSize);
+              str_sprintf(buf, "  StoreFileSize:      %ld (less than 1MB)", stats_->storeFileSize);
             else
-              str_sprintf(buf, "  StoreFileSize:      %Ld Bytes", stats_->storeFileSize);
+              str_sprintf(buf, "  StoreFileSize:      %ld Bytes", stats_->storeFileSize);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
             if (stats_->memStoreSize == 0)
-              str_sprintf(buf, "  MemStoreSize:       %Ld (less than 1MB)", stats_->memStoreSize);
+              str_sprintf(buf, "  MemStoreSize:       %ld (less than 1MB)", stats_->memStoreSize);
             else
-              str_sprintf(buf, "  MemStoreSize:       %Ld Bytes", stats_->memStoreSize);              
+              str_sprintf(buf, "  MemStoreSize:       %ld Bytes", stats_->memStoreSize);              
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  ReadRequestsCount:  %Ld", stats_->readRequestsCount);
+            str_sprintf(buf, "  ReadRequestsCount:  %ld", stats_->readRequestsCount);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
-            str_sprintf(buf, "  WriteRequestsCount: %Ld", stats_->writeRequestsCount);
+            str_sprintf(buf, "  WriteRequestsCount: %ld", stats_->writeRequestsCount);
 	    if (moveRowToUpQueue(buf, strlen(buf), &rc))
 	      return rc;
 
@@ -7331,7 +7330,7 @@ else
   else
     lobEOD = 0;
   
-  str_sprintf(buf, "  LOB EOD :  %Ld", lobEOD);
+  str_sprintf(buf, "  LOB EOD :  %ld", lobEOD);
   if (moveRowToUpQueue(buf, strlen(buf), &rc))
     return rc;
 
@@ -7354,7 +7353,7 @@ else
       return cliRC;
     }
 
-  str_sprintf(buf, "  LOB Used Len :  %Ld", outlen);
+  str_sprintf(buf, "  LOB Used Len :  %ld", outlen);
   if (moveRowToUpQueue(buf, strlen(buf), &rc))
     return rc;
   return 0;
@@ -7452,7 +7451,7 @@ short ExExeUtilLobInfoTcb::work()
           {
             if (getLItdb().getNumLobs() == 0)
               {
-                str_sprintf(buf, "  Num Lob Columns = 0", tableName_);
+                strcpy(buf, "  Num Lob Columns = 0");
                 if (moveRowToUpQueue(buf, strlen(buf), &rc))
                   return rc;
                 step_ = DONE_;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExExeUtilLoad.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilLoad.cpp b/core/sql/executor/ExExeUtilLoad.cpp
index 614adde..57345bf 100644
--- a/core/sql/executor/ExExeUtilLoad.cpp
+++ b/core/sql/executor/ExExeUtilLoad.cpp
@@ -3128,7 +3128,7 @@ short ExExeUtilLobExtractTcb::work()
               {
                 if ((lobTdb().getBufAddr() != -1) && (lobTdb().getBufAddr() != 0))
                   str_cpy_all((char *)lobTdb().getBufAddr(), (char *)&lobDataLen_,sizeof(Int64));
-                str_sprintf(statusString_," LOB Length : %d", lobDataLen_);
+                str_sprintf(statusString_," LOB Length : %ld", lobDataLen_);
                 step_ = RETURN_STATUS_;
                 break;	
               }
@@ -3207,7 +3207,7 @@ short ExExeUtilLobExtractTcb::work()
 		    step_ = HANDLE_ERROR_;
 		    break;
 		  }
-		str_sprintf(statusString_, "Success. Targetfile :%s  Length : %Ld", lobTdb().getFileName(), lobDataOutputLen);
+		str_sprintf(statusString_, "Success. Targetfile :%s  Length : %ld", lobTdb().getFileName(), lobDataOutputLen);
 		step_ = RETURN_STATUS_;
 	      }
 	    else if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
@@ -3323,7 +3323,7 @@ short ExExeUtilLobExtractTcb::work()
             
             if (lobTdb().getToType() == ComTdbExeUtilLobExtract::TO_BUFFER_)
 	      {
-		str_sprintf(statusString_," Success: LOB data length returned : %d", lobDataOutputLen);
+		str_sprintf(statusString_," Success: LOB data length returned : %ld", lobDataOutputLen);
 	       
 		//lobTdb().setExtractSizeIOAddr((Int64)(&lobDataOutputLen));
 		memcpy((char *)lobTdb().dataExtractSizeIOAddr(), (char *)&lobDataOutputLen,sizeof(Int64));
@@ -3687,7 +3687,7 @@ short ExExeUtilLobUpdateTcb::work()
 	      }  
             if (so == Lob_Buffer)
 	      {
-		str_sprintf(statusString_," Updated/Replaced %d bytes of LOB data ", lobLen);
+		str_sprintf(statusString_," Updated/Replaced %ld bytes of LOB data ", lobLen);
 		step_ = RETURN_STATUS_;
 	      }
             
@@ -3783,7 +3783,7 @@ short ExExeUtilLobUpdateTcb::work()
 	      }  
             if (so == Lob_Buffer)
 	      {
-		str_sprintf(statusString_," Updated/Appended %d bytes of LOB data ", lobLen);
+		str_sprintf(statusString_," Updated/Appended %ld bytes of LOB data ", lobLen);
 		step_ = RETURN_STATUS_;
 	      }
             

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExExeUtilMisc.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExeUtilMisc.cpp b/core/sql/executor/ExExeUtilMisc.cpp
index 7f4ba7a..aed6301 100644
--- a/core/sql/executor/ExExeUtilMisc.cpp
+++ b/core/sql/executor/ExExeUtilMisc.cpp
@@ -1818,14 +1818,14 @@ ExExeUtilPopulateInMemStatsTcb::~ExExeUtilPopulateInMemStatsTcb()
 static const QueryString deleteStatsQuery[] =
 {
   {" delete from %s "},
-  {"  where table_uid = %Ld"}
+  {"  where table_uid = %ld"}
 };
 
 static const QueryString populateHistogramsStatsQuery[] =
 {
   {" insert into %s "},
   {" select  "},
-  {"   %Ld, "},
+  {"   %ld, "},
   {"   histogram_id, "},
   {"   col_position, column_number, colcount, interval_count, rowcount, "},
   {"   total_uec, stats_time, low_value, high_value, read_time, read_count, "},
@@ -1852,7 +1852,7 @@ static const QueryString populateHistintsStatsQuery[] =
 {
   {" insert into %s "},
   {" select  "},
-  {"   %Ld, "},
+  {"   %ld, "},
   {"   histogram_id, "},
   {"   interval_number, interval_rowcount, interval_uec, interval_boundary, "},
   {"   std_dev_of_freq, "},
@@ -2360,7 +2360,7 @@ short ExExeUtilHiveTruncateTcb::work()
         if (cliRC == 1) // data mod check failed
         {
           char errStr[200];
-          str_sprintf(errStr, "genModTS = %Ld, failedModTS = %Ld", 
+          str_sprintf(errStr, "genModTS = %ld, failedModTS = %ld", 
                       htTdb().getModTS(), failedModTS);
           
           ComDiagsArea * diagsArea = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExExplain.cpp b/core/sql/executor/ExExplain.cpp
index fb7d4f0..51c3002 100644
--- a/core/sql/executor/ExExplain.cpp
+++ b/core/sql/executor/ExExplain.cpp
@@ -1810,7 +1810,7 @@ short ExExplainTcb::storeExplainInRepos(
     }
 
   queryBuf = new(heap) char[4000];
-  str_sprintf(queryBuf, "update %s.\"%s\".%s set explain_plan = cast(? as varchar(%d) not null) where exec_start_utc_ts = CONVERTTIMESTAMP(%Ld)  and query_id = '%s' ",
+  str_sprintf(queryBuf, "update %s.\"%s\".%s set explain_plan = cast(? as varchar(%d) not null) where exec_start_utc_ts = CONVERTTIMESTAMP(%ld)  and query_id = '%s' ",
               TRAFODION_SYSCAT_LIT, SEABASE_REPOS_SCHEMA, REPOS_METRIC_QUERY_TABLE, 
               REPOS_MAX_EXPLAIN_PLAN_LEN,
               *execStartUtcTs, qid);

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExFastTransport.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExFastTransport.cpp b/core/sql/executor/ExFastTransport.cpp
index c97104d..4219702 100644
--- a/core/sql/executor/ExFastTransport.cpp
+++ b/core/sql/executor/ExFastTransport.cpp
@@ -681,7 +681,7 @@ ExWorkProcRetcode ExHdfsFastExtractTcb::work()
       if (retcode == 1) // check failed
       {
         char errStr[200];
-        str_sprintf(errStr, "genModTS = %Ld, failedModTS = %Ld", 
+        str_sprintf(errStr, "genModTS = %ld, failedModTS = %ld", 
                     myTdb().getModTSforDir(), failedModTS);
         
         ComDiagsArea * diagsArea = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExHbaseAccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHbaseAccess.cpp b/core/sql/executor/ExHbaseAccess.cpp
index 02f8223..c9faba3 100644
--- a/core/sql/executor/ExHbaseAccess.cpp
+++ b/core/sql/executor/ExHbaseAccess.cpp
@@ -1346,7 +1346,7 @@ Lng32 ExHbaseAccessTcb::createSQRowFromHbaseFormat(Int64 *latestRowTimestamp)
                       else if (colName.length() == sizeof(ULng32))
                         v = *(ULng32*)colName.data();
                       
-                      str_sprintf(buf, "%Ld", v);
+                      str_sprintf(buf, "%ld", v);
                     }
                   
                   ComDiagsArea * diagsArea = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExHdfsScan.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExHdfsScan.cpp b/core/sql/executor/ExHdfsScan.cpp
index af5c56b..3b9baa5 100644
--- a/core/sql/executor/ExHdfsScan.cpp
+++ b/core/sql/executor/ExHdfsScan.cpp
@@ -498,7 +498,7 @@ ExWorkProcRetcode ExHdfsScanTcb::work()
                 if (retcode == 1) // check failed
                   {
                     char errStr[200];
-                    str_sprintf(errStr, "genModTS = %Ld, failedModTS = %Ld", 
+                    str_sprintf(errStr, "genModTS = %ld, failedModTS = %ld", 
                                 modTS, failedModTS);
 
                     ComDiagsArea * diagsArea = NULL;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ExSMGlobals.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ExSMGlobals.cpp b/core/sql/executor/ExSMGlobals.cpp
index 54fc606..45dda94 100644
--- a/core/sql/executor/ExSMGlobals.cpp
+++ b/core/sql/executor/ExSMGlobals.cpp
@@ -220,7 +220,7 @@ const char *ExSMGlobals::createSessionID(ExExeStmtGlobals *stmtGlob)
     return NULL;
   }
 
-  str_sprintf(smIDStr, "%d_%d_%Ld", (Int32) sqNodeNumber, (Int32) masterPID,
+  str_sprintf(smIDStr, "%d_%d_%ld", (Int32) sqNodeNumber, (Int32) masterPID,
               (Int64) masterStart);
 
   return smIDStr;

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/executor/ex_hashj.cpp
----------------------------------------------------------------------
diff --git a/core/sql/executor/ex_hashj.cpp b/core/sql/executor/ex_hashj.cpp
index bc032c4..a7c98ff 100644
--- a/core/sql/executor/ex_hashj.cpp
+++ b/core/sql/executor/ex_hashj.cpp
@@ -2023,7 +2023,7 @@ void ex_hashj_tcb::workEndPhase1() {
       char msg[1024];
       
       str_sprintf(msg, 
-		  "HJ End Phase 1 (%d). #inner rows: %Ld, #buckets: %d, #clusters: %d, #flushed: %d, total size %d MB, cluster size max- %d MB min- %d, variable size records: %s",
+		  "HJ End Phase 1 (%d). #inner rows: %ld, #buckets: %d, #clusters: %d, #flushed: %d, total size %d MB, cluster size max- %d MB min- %d, variable size records: %s",
 		  0,
 		  totalRightRowsRead_,
 		  bucketCount_ , numClusters, numFlushed, 

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/ExpLOB.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOB.cpp b/core/sql/exp/ExpLOB.cpp
index 2338850..8557c83 100644
--- a/core/sql/exp/ExpLOB.cpp
+++ b/core/sql/exp/ExpLOB.cpp
@@ -69,7 +69,7 @@ char * ExpLOBoper::ExpGetLOBname(Int64 uid, Lng32 num, char * outBuf, Lng32 outB
   if (outBufLen < 31)
     return NULL;
 
-  str_sprintf(outBuf, "LOBP_%020Ld_%04d",
+  str_sprintf(outBuf, "LOBP_%020ld_%04d",
 	      uid, num);
 
   return outBuf;
@@ -82,7 +82,7 @@ char * ExpLOBoper::ExpGetLOBDescName(Lng32 schNameLen, char * schName,
   if (outBufLen < 512)
     return NULL;
 
-  str_sprintf(outBuf, "%s.\"LOBDsc_%020Ld_%04d\"",
+  str_sprintf(outBuf, "%s.\"LOBDsc_%020ld_%04d\"",
 	      schName, uid, num);
 
   return outBuf;
@@ -94,7 +94,7 @@ char * ExpLOBoper::ExpGetLOBDescHandleObjNamePrefix(Int64 uid,
   if (outBufLen < 512)
     return NULL;
   
-  str_sprintf(outBuf, "%s_%020Ld", LOB_DESC_HANDLE_PREFIX,uid);
+  str_sprintf(outBuf, "%s_%020ld", LOB_DESC_HANDLE_PREFIX,uid);
   
   return outBuf;
 }
@@ -107,7 +107,7 @@ char * ExpLOBoper::ExpGetLOBDescHandleName(Lng32 schNameLen, char * schName,
       (schName == NULL))
     return NULL;
   
-  str_sprintf(outBuf, "%s.\"%s_%020Ld_%04d\"",
+  str_sprintf(outBuf, "%s.\"%s_%020ld_%04d\"",
 	      schName, LOB_DESC_HANDLE_PREFIX,uid, num);
   
   return outBuf;
@@ -115,7 +115,7 @@ char * ExpLOBoper::ExpGetLOBDescHandleName(Lng32 schNameLen, char * schName,
 
 Lng32 ExpLOBoper::ExpGetLOBnumFromDescName(char * descName, Lng32 descNameLen)
 {
-  // Desc Name Format: LOBDescHandle_%020Ld_%04d
+  // Desc Name Format: LOBDescHandle_%020ld_%04d
   char * lobNumPtr = &descName[sizeof(LOB_DESC_HANDLE_PREFIX) + 20 + 1];
   Lng32 lobNum = str_atoi(lobNumPtr, 4);
   
@@ -131,7 +131,7 @@ char * ExpLOBoper::ExpGetLOBDescChunksName(Lng32 schNameLen, char * schName,
       (schName == NULL))
     return NULL;
   
-  str_sprintf(outBuf, "%s.\"%s_%020Ld_%04d\"",
+  str_sprintf(outBuf, "%s.\"%s_%020ld_%04d\"",
 	      schName, LOB_DESC_CHUNK_PREFIX,uid, num);
 
   return outBuf;
@@ -146,7 +146,7 @@ char * ExpLOBoper::ExpGetLOBMDName(Lng32 schNameLen, char * schName,
   if (outBufLen < 512)
     return NULL;
 
-  str_sprintf(outBuf, "%s.\"%s_%020Ld\"",
+  str_sprintf(outBuf, "%s.\"%s_%020ld\"",
 	      schName, LOB_MD_PREFIX,uid);
 
   return outBuf;
@@ -471,7 +471,7 @@ void ExpLOBoper::createLOBhandleString(Int16 flags,
 				       char * schName,
 				       char * lobHandleBuf)
 {
-  str_sprintf(lobHandleBuf, "LOBH%04d%04d%04d%020Ld%02d%Ld%02d%Ld%03d%s",
+  str_sprintf(lobHandleBuf, "LOBH%04d%04d%04d%020ld%02d%ld%02d%ld%03d%s",
 	      flags, lobType, lobNum, uid,
 	      findNumDigits(descKey), descKey, 
 	      findNumDigits(descTS), descTS,
@@ -493,7 +493,7 @@ Lng32 ExpLOBoper::extractFromLOBstring(Int64 &uid,
 				       Lng32 handleLen)
 {
   // opp of:
-  //  str_sprintf(lobHandleBuf, "LOBH%04d%04d%04d%020Ld%02d%Ld%02d%Ld%03d%s",
+  //  str_sprintf(lobHandleBuf, "LOBH%04d%04d%04d%020ld%02d%ld%02d%ld%03d%s",
   //	      flags, lobType, lobNum, uid,
   //	      findNumDigits(descKey), descKey, 
   //	      findNumDigits(descTS), descTS,