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:31 UTC
[08/13] incubator-trafodion git commit: [TRAFODION-2754] Get
statistics cores sqlci or mxosrvr at str_sprintf()
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/ExpLOBaccess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpLOBaccess.cpp b/core/sql/exp/ExpLOBaccess.cpp
index af2846c..455fec1 100644
--- a/core/sql/exp/ExpLOBaccess.cpp
+++ b/core/sql/exp/ExpLOBaccess.cpp
@@ -254,7 +254,7 @@ Ex_Lob_Error ExLob::fetchCursor(char *handleIn, Int32 handleLenIn, Int64 &outOff
}
- str_sprintf(logBuf, " Returned after ::fetchCursor %Ld,%Ld",outOffset,outSize);
+ str_sprintf(logBuf, " Returned after ::fetchCursor %ld,%ld",outOffset,outSize);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
return err;
@@ -287,7 +287,7 @@ Ex_Lob_Error ExLob::getDesc(ExLobDesc &desc,char * handleIn, Int32 handleInLen,
desc.setOffset(offset);
desc.setSize(size);
- str_sprintf(logBuf,"After Cli LOB_CLI_SELECT_UNIQUE:descOffset:%Ld, descSize: %Ld",offset,size);
+ str_sprintf(logBuf,"After Cli LOB_CLI_SELECT_UNIQUE:descOffset:%ld, descSize: %ld",offset,size);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
return err;
}
@@ -602,7 +602,7 @@ Ex_Lob_Error ExLob::statSourceFile(char *srcfile, Int64 &sourceEOF)
else
return LOB_SOURCE_FILE_OPEN_ERROR;
- str_sprintf(logBuf,"Returning EOF of %Ld for file %s", sourceEOF,srcfile);
+ str_sprintf(logBuf,"Returning EOF of %ld for file %s", sourceEOF,srcfile);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
}
@@ -629,7 +629,7 @@ Ex_Lob_Error ExLob::statSourceFile(char *srcfile, Int64 &sourceEOF)
flock(fdSrcFile, LOCK_UN);
close(fdSrcFile);
- str_sprintf(logBuf,"Returning EOF of %Ld for file %s", sourceEOF,srcfile);
+ str_sprintf(logBuf,"Returning EOF of %ld for file %s", sourceEOF,srcfile);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
}
@@ -704,7 +704,7 @@ Ex_Lob_Error ExLob::readSourceFile(char *srcfile, char *&fileData, Int32 &size,
Ex_Lob_Error ExLob::readHdfsSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset)
{
char logBuf[4096];
- str_sprintf(logBuf,"Calling ::readHdfsSourceFile: %s Offset:%Ld, Size: %Ld",srcfile, offset,size);
+ str_sprintf(logBuf,"Calling ::readHdfsSourceFile: %s Offset:%ld, Size: %d",srcfile, offset,size);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
@@ -733,7 +733,7 @@ Ex_Lob_Error ExLob::readHdfsSourceFile(char *srcfile, char *&fileData, Int32 &si
Ex_Lob_Error ExLob::readLocalSourceFile(char *srcfile, char *&fileData, Int32 &size, Int64 offset)
{
char logBuf[4096];
- str_sprintf(logBuf,"Calling ::readLocalSourceFile: %s Offset:%Ld, Size: %Ld",srcfile, offset,size);
+ str_sprintf(logBuf,"Calling ::readLocalSourceFile: %s Offset:%ld, Size: %d",srcfile, offset,size);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
int openFlags = O_RDONLY;
@@ -926,7 +926,7 @@ Ex_Lob_Error ExLob::insertDesc(Int64 offset, Int64 size, char *handleIn, Int32
NABoolean foundUnused = FALSE;
char logBuf[4096];
lobDebugInfo("In ExLob::InsertDesc",0,__LINE__,lobTrace_);
- str_sprintf(logBuf,"Calling Cli LOB_CLI_INSERT: Offset:%Ld, Size: %Ld",
+ str_sprintf(logBuf,"Calling Cli LOB_CLI_INSERT: Offset:%ld, Size: %ld",
offset,size);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
clierr = SQL_EXEC_LOBcliInterface(handleIn,
@@ -938,7 +938,7 @@ Ex_Lob_Error ExLob::insertDesc(Int64 offset, Int64 size, char *handleIn, Int32
&outDescPartnKey, &outDescSyskey,
0,
xnId,lobTrace_);
- str_sprintf(logBuf,"After LOB_CLI_INSERT: ChunkNum: OutSyskey:%Ld",
+ str_sprintf(logBuf,"After LOB_CLI_INSERT: ChunkNum:%d OutSyskey:%ld",
chunkNum,outDescSyskey);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
lobDebugInfo("Leaving ExLob::InsertDesc",0,__LINE__,lobTrace_);
@@ -967,7 +967,7 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
allocMemSize = MINOF(lobMaxChunkMemSize, inputSize);
if (subOperation == Lob_File)
{
- str_sprintf(logBuf,"reading source file %s allocMemSize : %Ld, readOffset:%Ld", source,allocMemSize,readOffset);
+ str_sprintf(logBuf,"reading source file %s allocMemSize : %d, readOffset:%ld", source,allocMemSize,readOffset);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
err = readSourceFile(source, inputAddr, allocMemSize, readOffset);
if (err != LOB_OPER_OK)
@@ -983,7 +983,7 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
err = writeData(writeOffset, inputAddr, allocMemSize, operLen);
if (err != LOB_OPER_OK)
{
- str_sprintf(logBuf,"::writeData returned error .writeOffset:%Ld, allocMemSize:%Ld, operLen %Ld ", writeOffset,allocMemSize,operLen);
+ str_sprintf(logBuf,"::writeData returned error .writeOffset:%ld, allocMemSize:%d, operLen %ld ", writeOffset,allocMemSize,operLen);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
//handle errors that happen in one of the chunks.
return err;
@@ -993,7 +993,7 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
readOffset = readOffset+allocMemSize;
inputSize = inputSize-lobMaxChunkMemSize;
getLobGlobalHeap()->deallocateMemory(inputAddr);
- str_sprintf(logBuf,"Bookkeeping for Lob_File source.writeOffset:%Ld, readOffset:%Ld, inputSize: %Ld ", writeOffset,readOffset, inputSize);
+ str_sprintf(logBuf,"Bookkeeping for Lob_File source.writeOffset:%ld, readOffset:%ld, inputSize: %ld ", writeOffset,readOffset, inputSize);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
}
else
@@ -1001,7 +1001,7 @@ Ex_Lob_Error ExLob::writeLobData(char *source, Int64 sourceLen, LobsSubOper subO
writeOffset = writeOffset+allocMemSize;
inputSize = inputSize-lobMaxChunkMemSize;
inputAddr = inputAddr+allocMemSize;
- str_sprintf(logBuf,"Bookkeeping for Lob_Memory source. writeOffset:%Ld, inputSize: %Ld ", writeOffset, inputSize);
+ str_sprintf(logBuf,"Bookkeeping for Lob_Memory source. writeOffset:%ld, inputSize: %ld ", writeOffset, inputSize);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
}
}
@@ -1045,7 +1045,7 @@ Ex_Lob_Error ExLob::readToMem(char *memAddr, Int64 size, Int64 &operLen,char *
sizeToRead = size;
multipleChunks = TRUE;
}
- str_sprintf(logBuf,"sizeToRead:%Ld, desc.size :%Ld", sizeToRead, desc.getSize());
+ str_sprintf(logBuf,"sizeToRead:%ld, desc.size :%d", sizeToRead, desc.getSize());
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
err = readDataToMem(memAddr, desc.getOffset(),sizeToRead, operLen, handleIn,handleInLen, multipleChunks,transId);
@@ -1290,7 +1290,7 @@ Ex_Lob_Error ExLob::append(char *data, Int64 size, LobsSubOper so, Int64 headDes
char *inputAddr = data;
- str_sprintf(logBuf,"Calling writeLobData: inputAddr: %Ld, InputSize%Ld, tgtOffset:%Ld",(long)inputAddr,sourceLen,dataOffset);
+ str_sprintf(logBuf,"Calling writeLobData: inputAddr: %ld, InputSize%ld, tgtOffset:%ld",(long)inputAddr,sourceLen,dataOffset);
err = writeLobData(inputAddr, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
if (err != LOB_OPER_OK)
{
@@ -1307,7 +1307,7 @@ Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 head
operLen = 0;
char logBuf[4096];
lobDebugInfo("In ExLob::InsertData",0,__LINE__,lobTrace_);
- str_sprintf(logBuf,"data:%Ld, size %Ld, lobMaxSize:%Ld, lobMaxChunkMemSize:%Ld", (long)data, size,lobMaxSize,lobMaxChunkMemSize);
+ str_sprintf(logBuf,"data:%ld, size %ld, lobMaxSize:%ld, lobMaxChunkMemSize:%ld", (long)data, size,lobMaxSize,lobMaxChunkMemSize);
// get offset and input size from desc (the one that was just
// inserted into the descriptor handle table)
@@ -1327,7 +1327,7 @@ Ex_Lob_Error ExLob::insertData(char *data, Int64 size, LobsSubOper so,Int64 head
Int64 inputSize = desc.getSize();
Int64 tgtOffset = desc.getOffset();
- str_sprintf(logBuf,"Calling writeLobData: inputAddr: %Ld, InputSize%Ld, tgtOffset:%Ld",(long)inputAddr,inputSize,tgtOffset);
+ str_sprintf(logBuf,"Calling writeLobData: inputAddr: %ld, InputSize%ld, tgtOffset:%ld",(long)inputAddr,inputSize,tgtOffset);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
err = writeLobData(inputAddr, inputSize,so, tgtOffset,
@@ -1359,7 +1359,7 @@ Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDesc
lobDebugInfo("In ExLob::update",0,__LINE__,lobTrace_);
if ((so == Lob_File) || (so == Lob_External_File))
{
- str_sprintf(logBuf,"Calling statSourceFile: source:%s, sourceLen: %Ld",
+ str_sprintf(logBuf,"Calling statSourceFile: source:%s, sourceLen: %ld",
data,sourceLen);
lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
err = statSourceFile(data, sourceLen);
@@ -1399,11 +1399,11 @@ Ex_Lob_Error ExLob::update(char *data, Int64 size, LobsSubOper so,Int64 headDesc
}
char *inputAddr = data;
- str_sprintf(logBuf,"Calling writeLobData.sourceLen:%Ld, dataOffset:%Ld",sourceLen,dataOffset);
+ str_sprintf(logBuf,"Calling writeLobData.sourceLen:%ld, dataOffset:%ld",sourceLen,dataOffset);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
err = writeLobData(inputAddr, sourceLen,so,dataOffset,operLen,lobMaxChunkMemSize);
- str_sprintf(logBuf,"writeLobData returned. operLen:%Ld",operLen);
+ str_sprintf(logBuf,"writeLobData returned. operLen:%ld",operLen);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
if (err != LOB_OPER_OK){
lobDebugInfo("writeLobData Failed",0,__LINE__,lobTrace_);
@@ -1610,7 +1610,7 @@ Ex_Lob_Error ExLob::readCursor(char *tgt, Int64 tgtSize, char *handleIn, Int32 h
{
cursor = it->second;
}
- str_sprintf(logBuf,"ExLob::readCursor:: cliInterface:%Ld,bytesRead_:%Ld,descOffset_:%LddescSize_:%Ld,eod_:%d,eor_:%d,eol_:%d,",(long)cursor.cliInterface_,cursor.bytesRead_,cursor.descOffset_,cursor.descSize_,cursor.eod_,cursor.eor_,cursor.eol_);
+ str_sprintf(logBuf,"ExLob::readCursor:: cliInterface:%ld,bytesRead_:%ld,descOffset_:%lddescSize_:%ld,eod_:%d,eor_:%d,eol_:%d,",(long)cursor.cliInterface_,cursor.bytesRead_,cursor.descOffset_,cursor.descSize_,cursor.eod_,cursor.eor_,cursor.eol_);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
if (cursor.eod_) {
// remove cursor from the map.
@@ -1746,7 +1746,7 @@ Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset,
if ((lobGCLimit != 0) && (dataOffset > lobGCLimit)) // 5 GB default
{
- str_sprintf(logBuf,"Starting GC. Current Offset : %Ld",dataOffset);
+ str_sprintf(logBuf,"Starting GC. Current Offset : %ld",dataOffset);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
@@ -1781,10 +1781,10 @@ Ex_Lob_Error ExLob::allocateDesc(ULng32 size, Int64 &descNum, Int64 &dataOffset,
lobDataFileSubstr[len] = '\0';
if (GCDone)
- str_sprintf(logBuf,"Done GC. Allocating new Offset %Ld in %s",
+ str_sprintf(logBuf,"Done GC. Allocating new Offset %ld in %s",
dataOffset,lobDataFileSubstr);
else
- str_sprintf(logBuf,"Allocating new Offset %Ld in %s ",
+ str_sprintf(logBuf,"Allocating new Offset %ld in %s ",
dataOffset,lobDataFileSubstr);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
//Find the last offset in the file
@@ -2075,7 +2075,7 @@ Ex_Lob_Error ExLob::readCursorData(char *tgt, Int64 tgtSize, cursor_t &cursor, I
clock_gettime(CLOCK_MONOTONIC, &startTime);
bytesRead = hdfsPread(fs_, fdData_, offset, tgt, bytesToCopy);
- str_sprintf(logBuf,"After hdfsPread: BytesToCopy:%Ld, Offset:%Ld, tgt:%Ld, BytesRead :%Ld",
+ str_sprintf(logBuf,"After hdfsPread: BytesToCopy:%ld, Offset:%ld, tgt:%ld, BytesRead :%ld",
bytesToCopy,offset,(long)tgt,bytesRead);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
clock_gettime(CLOCK_MONOTONIC, &endTime);
@@ -2177,8 +2177,10 @@ Ex_Lob_Error ExLob::readDataToMem(char *memAddr,
strncpy(lobDataFileSubstr,lobDataFile_.data(),len);
lobDataFileSubstr[len] = '\0';
- str_sprintf(logBuf,"After hdfsPread: File:%s, Offset:%Ld, Size:%Ld,Target Mem Addr:%Ld",
- lobDataFileSubstr,offset,size,memAddr);
+ //str_sprintf(logBuf,"After hdfsPread: File:%s, Offset:%ld, Size:%ld,Target Mem Addr:%d",
+ // lobDataFileSubstr,offset,size,memAddr);
+ str_sprintf(logBuf,"After hdfsPread: File:%s, Offset:%ld, Size:%ld",
+ lobDataFileSubstr,offset,size);
lobDebugInfo(logBuf,0,__LINE__,lobTrace_);
operLen = bytesRead;
return LOB_OPER_OK;
@@ -2580,7 +2582,7 @@ Ex_Lob_Error ExLobsOper (
if (err != LOB_OPER_OK)
{
char buf[5000];
- str_sprintf(buf,"Lob initialization failed;filename:%s;location:%s;hdfsserver:%s;hdfsPort:%d;lobMaxSize:%Ld",fileName,lobStorageLocation,hdfsServer,lobMaxSize);
+ str_sprintf(buf,"Lob initialization failed;filename:%s;location:%s;hdfsserver:%s;lobMaxSize:%ld",fileName,lobStorageLocation,hdfsServer,lobMaxSize);
lobDebugInfo(buf,err,__LINE__,lobGlobals->lobTrace_);
return err;
}
@@ -2673,7 +2675,7 @@ Ex_Lob_Error ExLobsOper (
if (err != LOB_OPER_OK)
{
char buf[5000];
- str_sprintf(buf,"Lob initialization failed;filename:%s;location:%s;hdfsserver:%s;hdfsPort:%d;lobMaxSize:%Ld",srcLobName,lobStorageLocation,hdfsServer,lobMaxSize);
+ str_sprintf(buf,"Lob initialization failed;filename:%s;location:%s;hdfsserver:%s;lobMaxSize:%ld",srcLobName,lobStorageLocation,hdfsServer,lobMaxSize);
lobDebugInfo(buf,err,__LINE__,lobGlobals->lobTrace_);
return err;
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/ExpPCode.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/ExpPCode.cpp b/core/sql/exp/ExpPCode.cpp
index f3f2096..8be3829 100644
--- a/core/sql/exp/ExpPCode.cpp
+++ b/core/sql/exp/ExpPCode.cpp
@@ -1373,9 +1373,9 @@ void PCode::displayContents(PCIList code, Space *space) {
PCI * pci = iter.first();
while (pci != NULL) {
-
char tbuf[256];
- str_sprintf(buf, " PCI(%09d)[%3d,%d] %s(", pci, pci->getCodePosition(),
+// TODO: Need to check pci casting is correct
+ str_sprintf(buf, " PCI(%09ld)[%3d,%d] %s(", (Int64)pci, pci->getCodePosition(),
pci->getGeneratedCodeSize(),
PCIT::operationString(pci->getOperation()));
@@ -1458,9 +1458,9 @@ Int32 PCode::dumpContents(PCIList code, char * buf, Int32 bufLen) {
buf[0] = 0;
while (pci != NULL) {
-
+// TODO: Need to check pci casting is correct
char tbuf[256];
- str_sprintf(tbuf, "PCI(%09d)[%3d,%d] %s(", pci, pci->getCodePosition(),
+ str_sprintf(tbuf, "PCI(%09ld)[%3d,%d] %s(", (Int64)pci, pci->getCodePosition(),
pci->getGeneratedCodeSize(),
PCIT::operationString(pci->getOperation()));
len += str_len(tbuf);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/exp_attrs.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_attrs.cpp b/core/sql/exp/exp_attrs.cpp
index a1f3c88..43e92d6 100644
--- a/core/sql/exp/exp_attrs.cpp
+++ b/core/sql/exp/exp_attrs.cpp
@@ -340,11 +340,11 @@ void Attributes::displayContents(Space * space, Int32 operandNum,
Int64 ll = (Int64)lobLen;
// Int64 ll = (Int64)getPrecision() * 1000 + (Int64)getScale();
- str_sprintf(buf, " LobLength = %Ld Mb", ll);
+ str_sprintf(buf, " LobLength = %ld Mb", ll);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
}
- str_sprintf(buf, " Precision = %d, Scale = %d, Collation = %d, flags_ = %b",
+ str_sprintf(buf, " Precision = %d, Scale = %d, Collation = %d, flags_ = %x",
getPrecision(), getScale(), getCollation(), flags_);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
@@ -437,7 +437,7 @@ void Attributes::displayContents(Space * space, Int32 operandNum,
if ((getRowsetSize() > 0) ||
(getRowsetInfo()))
{
- str_sprintf(buf, " rowsetSize_ = %d, rowsetInfo_ = %b",
+ str_sprintf(buf, " rowsetSize_ = %d, rowsetInfo_ = %x",
getRowsetSize(), getRowsetInfo());
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/exp_clause.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_clause.cpp b/core/sql/exp/exp_clause.cpp
index 8050450..b66fd60 100644
--- a/core/sql/exp/exp_clause.cpp
+++ b/core/sql/exp/exp_clause.cpp
@@ -1590,12 +1590,12 @@ void ex_clause::displayContents(Space * space, const char * displayStr,
getOperTypeEnumAsString(operType_), operType_, numOperands_);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
- str_sprintf(buf, " ex_clause::flags_ = %b ",flags_ );
+ str_sprintf(buf, " ex_clause::flags_ = %x ",flags_ );
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
if (displayStr)
{
- str_sprintf(buf, " %s::flags_ = %b ", displayStr, clauseFlags);
+ str_sprintf(buf, " %s::flags_ = %x ", displayStr, clauseFlags);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
}
@@ -1966,7 +1966,7 @@ void ex_branch_clause::displayContents(Space * space, const char * /*displayStr*
getNumOperands());
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
- str_sprintf(buf, " flags_ = %b ", getAllFlags());
+ str_sprintf(buf, " flags_ = %x ", getAllFlags());
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
if (noPCodeAvailable())
@@ -2015,7 +2015,7 @@ void ex_comp_clause::displayContents(Space * space, const char * /*displayStr*/,
str_sprintf(buf, " ex_comp_clause::rollupColumnNum_ = %d", rollupColumnNum_);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
- str_sprintf(buf, " ex_comp_clause::flags_ = %b", flags_);
+ str_sprintf(buf, " ex_comp_clause::flags_ = %x", flags_);
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
ex_clause::displayContents(space, (const char *)NULL, clauseNum, constsArea,
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/exp_datetime.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_datetime.cpp b/core/sql/exp/exp_datetime.cpp
index 0d3f55e..42f266f 100644
--- a/core/sql/exp/exp_datetime.cpp
+++ b/core/sql/exp/exp_datetime.cpp
@@ -113,7 +113,7 @@ raiseDateConvErrorWithSrcDataNumeric(ComDiagsArea** diagsArea, long srcData, Col
{
char errstr[MAX_OFFENDING_SOURCE_DATA_DISPLAY_LEN];
str_pad(errstr, sizeof(errstr), 0 );
- str_sprintf(errstr,"%Ld",srcData);
+ str_sprintf(errstr,"%ld",srcData);
ExRaiseSqlError(heap, diagsArea, EXE_CONVERT_DATETIME_ERROR,NULL,NULL,NULL,NULL,errstr);
}
//////////////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/exp/exp_expr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/exp/exp_expr.cpp b/core/sql/exp/exp_expr.cpp
index 97d7ce0..b922504 100644
--- a/core/sql/exp/exp_expr.cpp
+++ b/core/sql/exp/exp_expr.cpp
@@ -257,7 +257,7 @@ void ex_expr::displayContents(Space * space, short mode, const char * displayStr
space->allocateAndCopyToAlignedSpace(buf, str_len(buf), sizeof(short));
str_sprintf(buf, "Expr Len: %d, Consts Len: %d", exprLen, getConstsLength());
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));
if (flag & 0x00000004)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/generator/GenExplain.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenExplain.cpp b/core/sql/generator/GenExplain.cpp
index 77d9c9f..aa2d3ed 100644
--- a/core/sql/generator/GenExplain.cpp
+++ b/core/sql/generator/GenExplain.cpp
@@ -708,12 +708,12 @@ static void appendListOfColumns(Queue* listOfColNames,ComTdb *tdb, NAString& out
else
v = 0;
if (j==0)
- str_sprintf(buf, "%s%s%Ld",
+ str_sprintf(buf, "%s%s%ld",
colFam,
(withAt ? "@" : ""),
v);
else
- str_sprintf(buf, ",%s%s%Ld",
+ str_sprintf(buf, ",%s%s%ld",
colFam,
(withAt ? "@" : ""),
v);
@@ -804,7 +804,7 @@ static void appendPushedDownExpression(ComTdb *tdb, NAString& outNAString){
v = *(ULng32*)colName;
else
v = 0;
- str_sprintf(buf2, "%s%s%Ld",
+ str_sprintf(buf2, "%s%s%ld",
colFam,
(withAt ? "@" : ""),
v);
@@ -1724,7 +1724,7 @@ RelRoot::addSpecificExplainInfo(ExplainTupleMaster *explainTuple,
ComQIActionTypeEnumToLiteral(sikValue[i].getSecurityKeyType(),
sikOperationLit);
sikOperationLit[2] = '\0';
- str_sprintf(buf, "{%Ld,%Ld,%s}",
+ str_sprintf(buf, "{%ld,%ld,%s}",
(Int64)sikValue[i].getSubjectHashValue(),
(Int64)sikValue[i].getObjectHashValue(),
sikOperationLit);
@@ -1737,12 +1737,12 @@ RelRoot::addSpecificExplainInfo(ExplainTupleMaster *explainTuple,
if (objectUIDs)
{
char buf[64];
- str_sprintf(buf, "ObjectUIDs: %Ld", objectUIDs[0]);
+ str_sprintf(buf, "ObjectUIDs: %ld", objectUIDs[0]);
statement += buf;
Int32 numO = rootTdb->getNumObjectUIDs();
for (Int32 i = 1; i < numO; i++)
{
- str_sprintf(buf, ", %Ld", objectUIDs[i]);
+ str_sprintf(buf, ", %ld", objectUIDs[i]);
statement += buf;
}
statement += " ";
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/generator/GenRelEnforcer.cpp
----------------------------------------------------------------------
diff --git a/core/sql/generator/GenRelEnforcer.cpp b/core/sql/generator/GenRelEnforcer.cpp
index cd28ed0..ae4cf22 100644
--- a/core/sql/generator/GenRelEnforcer.cpp
+++ b/core/sql/generator/GenRelEnforcer.cpp
@@ -343,7 +343,7 @@ short Exchange::codeGenForESP(Generator * generator)
ComUID uid;
uid.make_UID();
Int64 i64 = uid.get_value();
- str_sprintf(extractSecurityKey, "%Ld", i64);
+ str_sprintf(extractSecurityKey, "%ld", i64);
}
else
{
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/optimizer/BindItemExpr.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/BindItemExpr.cpp b/core/sql/optimizer/BindItemExpr.cpp
index de5cc78..8990db3 100644
--- a/core/sql/optimizer/BindItemExpr.cpp
+++ b/core/sql/optimizer/BindItemExpr.cpp
@@ -11797,7 +11797,7 @@ ItemExpr *ZZZBinderFunction::bindNode(BindWA *bindWA)
i--;
}
- str_sprintf(buf, "@A1 / %Ld", denom);
+ str_sprintf(buf, "@A1 / %ld", denom);
}
if (strlen(buf) > 0)
@@ -11818,7 +11818,7 @@ ItemExpr *ZZZBinderFunction::bindNode(BindWA *bindWA)
// multiply by 10 ** (number of digits rounded off) to
// get back to the original scale.
- str_sprintf(buf, "cast(@A1 * %Ld as numeric(%d,%d))",
+ str_sprintf(buf, "cast(@A1 * %ld as numeric(%d,%d))",
denom, MAX_NUMERIC_PRECISION, MAXOF(type_op1.getScale(), roundTo));
parseTree = parser.getItemExprTree(buf, strlen(buf), BINDITEMEXPR_STMTCHARSET, 2, divExpr, child(1));
if (! parseTree)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/optimizer/CmpProcess.cpp
----------------------------------------------------------------------
diff --git a/core/sql/optimizer/CmpProcess.cpp b/core/sql/optimizer/CmpProcess.cpp
index b3e2eae..73a274c 100644
--- a/core/sql/optimizer/CmpProcess.cpp
+++ b/core/sql/optimizer/CmpProcess.cpp
@@ -112,7 +112,7 @@ CmpProcess::getCompilerId(char *id)
CMPASSERT( NULL != id );
str_sprintf
- (id, "%018Ld%02d%04d%03d",
+ (id, "%018ld%02d%04d%03d",
getProcessStartTime(),
getNodeNum(),
getPin(),
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sort/Qsort.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sort/Qsort.cpp b/core/sql/sort/Qsort.cpp
index 5198394..4699f30 100644
--- a/core/sql/sort/Qsort.cpp
+++ b/core/sql/sort/Qsort.cpp
@@ -232,7 +232,7 @@ Lng32 Qsort::sortSend(void *rec, ULng32 len, void* tupp)
{
char msg[500];
str_sprintf(msg,
- "QSort::SortSend, Sort has overflowed due to unavailable memory request of size %d MB",
+ "QSort::SortSend, Sort has overflowed due to unavailable memory request of size %ld MB",
(sizeof(Record) * allocRunSize_ * 2)/ ONE_MB);
SQLMXLoggingArea::logExecRtInfo(NULL,0,msg,explainNodeId_);
sortUtil_->config()->setLogInfoEventDone();
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sort/SortUtil.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sort/SortUtil.cpp b/core/sql/sort/SortUtil.cpp
index 722c60b..f8294e8 100644
--- a/core/sql/sort/SortUtil.cpp
+++ b/core/sql/sort/SortUtil.cpp
@@ -337,7 +337,7 @@ Lng32 SortUtil::sortSendEnd(NABoolean& internalSort)
{
char msg[500];
str_sprintf(msg,
- "Sort is performing %s sort: NumRecs:%d",
+ "Sort is performing %s sort: NumRecs:%ld",
internalSort? "internal":"external", stats_.numRecs_);
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
}
@@ -428,7 +428,7 @@ Lng32 SortUtil::sortReceivePrepare(void)
{
char msg[500];
str_sprintf(msg,
- "Sort Merge Phase encountered memory pressure: NumRuns:%d, MergeOrder:%d, NumRecs:%d, ScratchBlocks:%d",
+ "Sort Merge Phase encountered memory pressure: NumRuns:%d, MergeOrder:%d, NumRecs:%ld, ScratchBlocks:%d",
stats_.numRuns_, config_->mergeOrder_, stats_.numRecs_,stats_.scrNumBlocks_);
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
@@ -522,7 +522,7 @@ Lng32 SortUtil::sortReceivePrepare(void)
{
char msg[500];
str_sprintf(msg,
- "Sort is performing intermediate merges, NumRuns:%d, MergeOrder:%d, NumRecs:%d, ScratchBlocks:%d",
+ "Sort is performing intermediate merges, NumRuns:%d, MergeOrder:%d, NumRecs:%ld, ScratchBlocks:%d",
stats_.numRuns_,config_->mergeOrder_,stats_.numRecs_,stats_.scrNumBlocks_);
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
@@ -678,7 +678,7 @@ Lng32 SortUtil::sortReceivePrepare(void)
{
char msg[500];
str_sprintf(msg,
- "Sort is not performing intermediate merges, NumRuns:%d, MergeOrder:%d, NumRecs:%d, ScratchBlocks:%d",
+ "Sort is not performing intermediate merges, NumRuns:%d, MergeOrder:%d, NumRecs:%ld, ScratchBlocks:%d",
stats_.numRuns_,config_->mergeOrder_,stats_.numRecs_,stats_.scrNumBlocks_);
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
@@ -767,7 +767,7 @@ Lng32 SortUtil::sortReceive(void* record, ULng32& len)
stats_.elapsedTime_ = currentTimeJ - stats_.beginSortTime_;
if (config_->logInfoEvent()) {
char msg[500];
- str_sprintf(msg, "Sort elapsed time : %Ld; Num runs : %d; runsize :%d",
+ str_sprintf(msg, "Sort elapsed time : %ld; Num runs : %d; runsize :%d",
stats_.elapsedTime_,stats_.numInitRuns_,sortAlgo_->getRunSize());
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
}
@@ -801,7 +801,7 @@ Lng32 SortUtil::sortReceive(void*& record,ULng32& len,void*& tupp)
stats_.elapsedTime_ = currentTimeJ - stats_.beginSortTime_;
if (config_->logInfoEvent()) {
char msg[500];
- str_sprintf(msg, "Internal sort performed. Sort elapsed time : %Ld; Num runs : %d; runsize :%d",
+ str_sprintf(msg, "Internal sort performed. Sort elapsed time : %ld; Num runs : %d; runsize :%d",
stats_.elapsedTime_,stats_.numInitRuns_,sortAlgo_->getRunSize());
SQLMXLoggingArea::logExecRtInfo(NULL, 0,msg, explainNodeId_);
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlci/SqlCmd.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlci/SqlCmd.cpp b/core/sql/sqlci/SqlCmd.cpp
index 3972c4f..30a273c 100644
--- a/core/sql/sqlci/SqlCmd.cpp
+++ b/core/sql/sqlci/SqlCmd.cpp
@@ -741,7 +741,7 @@ short SqlCmd::updateRepos(SqlciEnv * sqlci_env, SQLSTMT_ID * stmt, char * queryI
char * queryBuf = new char[4000];
Int64 ts = NA_JulianTimestamp();
- str_sprintf(queryBuf, "insert into %s.\"%s\".%s (instance_id, tenant_id, host_id, exec_start_utc_ts, query_id, explain_plan) values (0,0,0, CONVERTTIMESTAMP(%Ld), '%s', '' ) ",
+ str_sprintf(queryBuf, "insert into %s.\"%s\".%s (instance_id, tenant_id, host_id, exec_start_utc_ts, query_id, explain_plan) values (0,0,0, CONVERTTIMESTAMP(%ld), '%s', '' ) ",
TRAFODION_SYSCAT_LIT, SEABASE_REPOS_SCHEMA, REPOS_METRIC_QUERY_TABLE,
ts, queryId);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpDescribe.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpDescribe.cpp b/core/sql/sqlcomp/CmpDescribe.cpp
index cccdf6c..5ba8fa7 100644
--- a/core/sql/sqlcomp/CmpDescribe.cpp
+++ b/core/sql/sqlcomp/CmpDescribe.cpp
@@ -2321,7 +2321,7 @@ short CmpDescribeHiveTable (
NAString bufnas(buf);
outputLongLine(space, bufnas, 0);
- str_sprintf(buf, "/* ObjectUID = %Ld */", objectUID);
+ str_sprintf(buf, "/* ObjectUID = %ld */", objectUID);
outputShortLine(space, buf);
}
@@ -2448,7 +2448,7 @@ short CmpDescribeHiveTable (
NAString bufnas(buf);
outputLongLine(space, bufnas, 0);
- str_sprintf(buf, "/* ObjectUID = %Ld */", objectUID);
+ str_sprintf(buf, "/* ObjectUID = %ld */", objectUID);
outputShortLine(space, buf);
}
@@ -3780,7 +3780,7 @@ short CmpDescribeSeabaseTable (
NAString bufnas(buf);
outputLongLine(*space, bufnas, 0);
- str_sprintf(buf, "/* ObjectUID = %Ld */", objectUID);
+ str_sprintf(buf, "/* ObjectUID = %ld */", objectUID);
outputShortLine(*space, buf);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
index ea2d3f2..b3750e9 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLauth.cpp
@@ -503,7 +503,7 @@ void CmpSeabaseDDLauth::insertRow()
NAString authValid = isAuthValid() ? "Y" : "N";
NAString sysCat = CmpSeabaseDDL::getSystemCatalogStatic();
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%d, '%s', '%s', '%s', %d, '%s', %Ld, %Ld, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%d, '%s', '%s', '%s', %d, '%s', %ld, %ld, 0)",
sysCat.data(), SEABASE_MD_SCHEMA, SEABASE_AUTHS,
getAuthID(),
getAuthDbName().data(),
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
index 9788b25..3d98d66 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcleanup.cpp
@@ -353,7 +353,7 @@ short CmpSeabaseMDcleanup::gatherDependentObjects(ExeCliInterface *cliInterface)
if (objType_ == COM_BASE_TABLE_OBJECT_LIT)
{
// generate dependent index uid list
- str_sprintf(query, "select index_uid from %s.\"%s\".%s where base_table_uid = %Ld",
+ str_sprintf(query, "select index_uid from %s.\"%s\".%s where base_table_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
objUID_);
@@ -366,7 +366,7 @@ short CmpSeabaseMDcleanup::gatherDependentObjects(ExeCliInterface *cliInterface)
}
// generate unique constr list
- str_sprintf(query, "select constraint_uid from %s.\"%s\".%s where table_uid = %Ld and constraint_type = 'U' ",
+ str_sprintf(query, "select constraint_uid from %s.\"%s\".%s where table_uid = %ld and constraint_type = 'U' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
objUID_);
@@ -379,7 +379,7 @@ short CmpSeabaseMDcleanup::gatherDependentObjects(ExeCliInterface *cliInterface)
}
// generate ref constr list
- str_sprintf(query, "select constraint_uid from %s.\"%s\".%s where table_uid = %Ld and constraint_type = 'F' ",
+ str_sprintf(query, "select constraint_uid from %s.\"%s\".%s where table_uid = %ld and constraint_type = 'F' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
objUID_);
@@ -505,7 +505,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
// Now delete from OBJECTS (but not its index)
- str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -525,7 +525,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// OBJECTS index
- str_sprintf(query, "delete from table(index_table %s.\"%s\".%s) where \"OBJECT_UID@\" = %Ld",
+ str_sprintf(query, "delete from table(index_table %s.\"%s\".%s) where \"OBJECT_UID@\" = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS_UNIQ_IDX,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -536,7 +536,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// COLUMNS table
- str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -547,7 +547,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// KEYS table
- str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_KEYS,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -558,7 +558,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// TABLES table
- str_sprintf(query, "delete from %s.\"%s\".%s where table_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where table_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -569,7 +569,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// delete index entries
- str_sprintf(query, "delete from %s.\"%s\".%s where base_table_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where base_table_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -580,7 +580,7 @@ short CmpSeabaseMDcleanup::deleteMDentries(ExeCliInterface *cliInterface)
}
// TEXT entries
- str_sprintf(query, "delete from %s.\"%s\".%s where text_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where text_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -611,7 +611,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
OutputInfo * oi = (OutputInfo*)uniqueConstrUIDlist_->getCurr();
ucUID = *(Int64*)oi->get(0);
- str_sprintf(query, "delete from %s.\"%s\".%s where unique_constraint_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where unique_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_REF_CONSTRAINTS,
ucUID);
cliRC = cliInterface->executeImmediate(query);
@@ -621,7 +621,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
return -1;
}
- str_sprintf(query, "delete from %s.\"%s\".%s where unique_constraint_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where unique_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_UNIQUE_REF_CONSTR_USAGE,
ucUID);
cliRC = cliInterface->executeImmediate(query);
@@ -644,7 +644,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
OutputInfo * oi = (OutputInfo*)refConstrUIDlist_->getCurr();
rcUID = *(Int64*)oi->get(0);
- str_sprintf(query, "delete from %s.\"%s\".%s where ref_constraint_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where ref_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_REF_CONSTRAINTS,
rcUID);
cliRC = cliInterface->executeImmediate(query);
@@ -654,7 +654,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
return -1;
}
- str_sprintf(query, "delete from %s.\"%s\".%s where foreign_constraint_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where foreign_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_UNIQUE_REF_CONSTR_USAGE,
rcUID);
cliRC = cliInterface->executeImmediate(query);
@@ -668,7 +668,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
} // for
}
- str_sprintf(query, "delete from %s.\"%s\".%s where object_uid in (select constraint_uid from %s.\"%s\".%s where table_uid = %Ld)",
+ str_sprintf(query, "delete from %s.\"%s\".%s where object_uid in (select constraint_uid from %s.\"%s\".%s where table_uid = %ld)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
objUID_);
@@ -679,7 +679,7 @@ short CmpSeabaseMDcleanup::deleteMDConstrEntries(ExeCliInterface *cliInterface)
return -1;
}
- str_sprintf(query, "delete from %s.\"%s\".%s where table_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where table_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -697,7 +697,7 @@ short CmpSeabaseMDcleanup::deleteMDViewEntries(ExeCliInterface *cliInterface)
Lng32 cliRC = 0;
char query[1000];
- str_sprintf(query, "delete from %s.\"%s\".%s where view_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where view_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS,
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -707,7 +707,7 @@ short CmpSeabaseMDcleanup::deleteMDViewEntries(ExeCliInterface *cliInterface)
return -1;
}
- str_sprintf(query, "delete from %s.\"%s\".%s where used_object_uid = %Ld and used_object_type = '%s' ",
+ str_sprintf(query, "delete from %s.\"%s\".%s where used_object_uid = %ld and used_object_type = '%s' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS_USAGE,
objUID_,
objType_.data());
@@ -756,7 +756,7 @@ short CmpSeabaseMDcleanup::dropIndexes(ExeCliInterface *cliInterface)
OutputInfo * oi = (OutputInfo*)indexesUIDlist_->getCurr();
iUID = *(Int64*)oi->get(0);
- str_sprintf(query, "cleanup uid %Ld",
+ str_sprintf(query, "cleanup uid %ld",
iUID);
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
@@ -788,7 +788,7 @@ short CmpSeabaseMDcleanup::dropSequences(ExeCliInterface *cliInterface)
OutputInfo * oi = (OutputInfo*)seqUIDlist_->getCurr();
iUID = *(Int64*)oi->get(0);
- str_sprintf(query, "cleanup uid %Ld",
+ str_sprintf(query, "cleanup uid %ld",
iUID);
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
@@ -875,7 +875,7 @@ short CmpSeabaseMDcleanup::deletePrivs(ExeCliInterface *cliInterface)
if (NOT isAuthorizationEnabled())
return 0;
- str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %Ld",
+ str_sprintf(query, "delete from %s.\"%s\".%s where object_uid = %ld",
getSystemCatalog(), SEABASE_PRIVMGR_SCHEMA, "OBJECT_PRIVILEGES",
objUID_);
cliRC = cliInterface->executeImmediate(query);
@@ -929,7 +929,7 @@ void CmpSeabaseMDcleanup::cleanupSchemaObjects(ExeCliInterface *cliInterface)
NAString obj_name((char*)oi->get(2));
if (isHistogramTable(obj_name))
{
- str_sprintf(query, "cleanup uid %Ld", uid);
+ str_sprintf(query, "cleanup uid %ld", uid);
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
{
@@ -975,7 +975,7 @@ void CmpSeabaseMDcleanup::cleanupSchemaObjects(ExeCliInterface *cliInterface)
continue;
}
- str_sprintf(query, "cleanup uid %Ld", uid);
+ str_sprintf(query, "cleanup uid %ld", uid);
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
{
@@ -1020,7 +1020,7 @@ short CmpSeabaseMDcleanup::cleanupUIDs(ExeCliInterface *cliInterface,
OutputInfo * oi = (OutputInfo*)entriesList->getCurr();
Int64 objUID = *(Int64*)oi->get(0);
- str_sprintf(query, "cleanup uid %Ld", objUID);
+ str_sprintf(query, "cleanup uid %ld", objUID);
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
{
@@ -1121,9 +1121,7 @@ void CmpSeabaseMDcleanup::cleanupHBaseObject(const StmtDDLCleanupObjects * stmtC
// drop external table
str_sprintf(query, "drop external table if exists %s;",
- objName.data(),
- stmtCleanupNode->getTableNameAsQualifiedName()->
- getQualifiedNameAsString().data());
+ objName.data());
cliRC = cliInterface->executeImmediate(query);
if (cliRC < 0)
{
@@ -1466,8 +1464,7 @@ short CmpSeabaseMDcleanup::cleanupInconsistentObjectsEntries(ExeCliInterface *cl
str_sprintf(query, "select distinct object_uid, cast(object_uid as varchar(30) not null) from %s.\"%s\".%s where object_uid not in (select object_uid from %s.\"%s\".%s) ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
- getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
- getSystemCatalog());
+ getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS);
cliRC = cliInterface->fetchAllRows(obsoleteEntriesList_, query, 0, FALSE, FALSE, TRUE);
if (cliRC < 0)
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
index e7a9f5b..c0a74b7 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp
@@ -3529,12 +3529,12 @@ short CmpSeabaseDDL::getObjectName(
ExeCliInterface cqdCliInterface(STMTHEAP);
if (lookInObjectsIdx)
- str_sprintf(buf, "select catalog_name, schema_name, object_name, object_type from table(index_table %s.\"%s\".%s) where \"OBJECT_UID@\" = %Ld ",
+ str_sprintf(buf, "select catalog_name, schema_name, object_name, object_type from table(index_table %s.\"%s\".%s) where \"OBJECT_UID@\" = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS_UNIQ_IDX,
objUID);
else
{
- str_sprintf(buf, "select catalog_name, schema_name, object_name, object_type from %s.\"%s\".%s where object_uid = %Ld ",
+ str_sprintf(buf, "select catalog_name, schema_name, object_name, object_type from %s.\"%s\".%s where object_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
objUID);
}
@@ -3922,7 +3922,7 @@ Int64 CmpSeabaseDDL::getConstraintOnIndex(
char buf[4000];
- str_sprintf(buf, "select C.constraint_uid, O.catalog_name, O.schema_name, O.object_name from %s.\"%s\".%s C, %s.\"%s\".%s O where C.table_uid = %Ld and C.index_uid = %Ld and C.constraint_type = '%s' and C.constraint_uid = O.object_uid",
+ str_sprintf(buf, "select C.constraint_uid, O.catalog_name, O.schema_name, O.object_name from %s.\"%s\".%s C, %s.\"%s\".%s O where C.table_uid = %ld and C.index_uid = %ld and C.constraint_type = '%s' and C.constraint_uid = O.object_uid",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
btUID, indexUID, constrType);
@@ -3957,7 +3957,7 @@ short CmpSeabaseDDL::getUsingObject(ExeCliInterface *cliInterface,
Lng32 cliRC = 0;
char buf[4000];
- str_sprintf(buf, "select trim(catalog_name) || '.' || trim(schema_name) || '.' || trim(object_name) from %s.\"%s\".%s T, %s.\"%s\".%s VU where VU.used_object_uid = %Ld and T.object_uid = VU.using_view_uid and T.valid_def = 'Y' ",
+ str_sprintf(buf, "select trim(catalog_name) || '.' || trim(schema_name) || '.' || trim(object_name) from %s.\"%s\".%s T, %s.\"%s\".%s VU where VU.used_object_uid = %ld and T.object_uid = VU.using_view_uid and T.valid_def = 'Y' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS_USAGE,
objUID);
@@ -4067,7 +4067,7 @@ short CmpSeabaseDDL::getUsingViews(ExeCliInterface *cliInterface,
str_sprintf(buf, "select '\"' || trim(catalog_name) || '\"' || '.' || '\"' || trim(schema_name) || '\"' || '.' || '\"' || trim(object_name) || '\"' "
"from %s.\"%s\".%s T, %s.\"%s\".%s VU "
"where T.object_uid = VU.using_view_uid and "
- "T.valid_def = 'Y' and VU.used_object_uid = %Ld ",
+ "T.valid_def = 'Y' and VU.used_object_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS_USAGE,
objectUID);
@@ -4202,7 +4202,7 @@ short CmpSeabaseDDL::getAllIndexes(ExeCliInterface *cliInterface,
Lng32 cliRC = 0;
char query[4000];
- str_sprintf(query, "select O.catalog_name, O.schema_name, O.object_name, O.object_uid from %s.\"%s\".%s I, %s.\"%s\".%s O , %s.\"%s\".%s T where I.base_table_uid = %Ld and I.index_uid = O.object_uid %s and I.index_uid = T.table_uid and I.keytag != 0 for read committed access ",
+ str_sprintf(query, "select O.catalog_name, O.schema_name, O.object_name, O.object_uid from %s.\"%s\".%s I, %s.\"%s\".%s O , %s.\"%s\".%s T where I.base_table_uid = %ld and I.index_uid = O.object_uid %s and I.index_uid = T.table_uid and I.keytag != 0 for read committed access ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
@@ -4563,7 +4563,7 @@ short CmpSeabaseDDL::updateSeabaseMDObjectsTable(
NAString quotedObjName;
ToQuotedString(quotedObjName, NAString(objName), FALSE);
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, %Ld )",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld, '%s', '%s', %d, %d, %ld )",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
catName, quotedSchName.data(), quotedObjName.data(),
objectTypeLit,
@@ -4712,7 +4712,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
Lng32 rowTotalLength = 0;
for (Lng32 i = 0; i < numKeys; i++)
{
- str_sprintf(buf, "upsert into %s.\"%s\".%s values (%Ld, '%s', %d, %d, %d, %d, 0)",
+ str_sprintf(buf, "upsert into %s.\"%s\".%s values (%ld, '%s', %d, %d, %d, %d, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_KEYS,
objUID,
keyInfo->colName,
@@ -4898,7 +4898,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
}
else
{
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, '%s', %d, '%s', %d, '%s', %d, %d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %Ld)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', %d, '%s', %d, '%s', %d, %d, %d, %d, %d, '%s', %d, %d, '%s', %d, '%s', '%s', '%s', '%s', '%s', '%s', %ld)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
objUID,
colInfo->colName,
@@ -5006,7 +5006,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
hbaseCreateOptions = tableInfo->hbaseCreateOptions;
}
- str_sprintf(buf, "upsert into %s.\"%s\".%s values (%Ld, '%s', '%s', %d, %d, %d, %d, %Ld) ",
+ str_sprintf(buf, "upsert into %s.\"%s\".%s values (%ld, '%s', '%s', %d, %d, %d, %d, %ld) ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
objUID,
rowFormat,
@@ -5049,7 +5049,7 @@ short CmpSeabaseDDL::updateSeabaseMDTable(
catalogNamePart.data(), schemaNamePart.data(), objectNamePart.data(),
COM_BASE_TABLE_OBJECT_LIT);
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, %d, %d, %d, %d, %d, %Ld, 0) ",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, %d, %d, %d, %d, %d, %ld, 0) ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
baseTableUID,
indexInfo->keytag,
@@ -5121,7 +5121,7 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
NAString quotedLibObjName;
ToQuotedString(quotedLibObjName, NAString(libName), FALSE);
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, 0 )",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld, '%s', '%s', %d, %d, 0 )",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
catName, quotedSchName.data(), quotedLibObjName.data(),
COM_LIBRARY_OBJECT_LIT,
@@ -5140,7 +5140,7 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
return -1;
}
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, '%s', %d, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', %d, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
libObjUID, libPath, routineInfo->library_version);
@@ -5193,7 +5193,7 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
return -1;
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', %Ld, '%s', 0 )",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', %ld, '%s', 0 )",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_ROUTINES,
spjObjUID,
routineInfo->UDR_type,
@@ -5221,7 +5221,7 @@ short CmpSeabaseDDL::updateSeabaseMDSPJ(
return -1;
}
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%Ld, %Ld, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%ld, %ld, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES_USAGE,
libObjUID, spjObjUID);
@@ -5267,7 +5267,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
if (objType == COM_LIBRARY_OBJECT)
{
- str_sprintf(buf, "delete from %s.\"%s\".%s where library_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where library_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5281,7 +5281,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
if (objType == COM_SEQUENCE_GENERATOR_OBJECT)
{
- str_sprintf(buf, "delete from %s.\"%s\".%s where seq_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where seq_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_SEQ_GEN,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5292,7 +5292,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
}
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where object_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_COLUMNS,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5304,7 +5304,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
}
// delete data from TEXT table
- str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5317,7 +5317,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
if (objType == COM_USER_DEFINED_ROUTINE_OBJECT)
{
- str_sprintf(buf, "delete from %s.\"%s\".%s where udr_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where udr_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_ROUTINES,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5326,7 +5326,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
cliInterface->retrieveSQLDiagnostics(CmpCommon::diags());
return -1;
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where used_udr_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where used_udr_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES_USAGE,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5338,7 +5338,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
return 0; // nothing else to do for routines
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where object_uid = %Ld ",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where object_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_KEYS,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5349,7 +5349,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
return -1;
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %Ld ",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5362,7 +5362,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
if (objType == COM_INDEX_OBJECT)
{
- str_sprintf(buf, "delete from %s.\"%s\".%s where index_uid = %Ld ",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where index_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_INDEXES,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5376,7 +5376,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
if (objType == COM_VIEW_OBJECT)
{
- str_sprintf(buf, "delete from %s.\"%s\".%s where view_uid = %Ld ",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where view_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5387,7 +5387,7 @@ short CmpSeabaseDDL::deleteFromSeabaseMDTable(
return -1;
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where using_view_uid = %Ld ",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where using_view_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VIEWS_USAGE,
objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5424,7 +5424,7 @@ short CmpSeabaseDDL::deleteConstraintInfoFromSeabaseMDTables(
return -1;
// delete data from table constraints MD
- str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %Ld and constraint_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %ld and constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLE_CONSTRAINTS,
tableUID, constrUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5436,7 +5436,7 @@ short CmpSeabaseDDL::deleteConstraintInfoFromSeabaseMDTables(
}
// delete data from ref constraints MD
- str_sprintf(buf, "delete from %s.\"%s\".%s where ref_constraint_uid = %Ld and unique_constraint_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where ref_constraint_uid = %ld and unique_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_REF_CONSTRAINTS,
constrUID, otherConstrUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5448,7 +5448,7 @@ short CmpSeabaseDDL::deleteConstraintInfoFromSeabaseMDTables(
}
// delete data from unique ref constraints usage MD
- str_sprintf(buf, "delete from %s.\"%s\".%s where unique_constraint_uid = %Ld and foreign_constraint_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where unique_constraint_uid = %ld and foreign_constraint_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_UNIQUE_REF_CONSTR_USAGE,
otherConstrUID, constrUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5460,7 +5460,7 @@ short CmpSeabaseDDL::deleteConstraintInfoFromSeabaseMDTables(
}
// delete data from TEXT table
- str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
constrUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -5599,13 +5599,13 @@ short CmpSeabaseDDL::updateObjectRedefTime(
if ((flags & MD_OBJECTS_STORED_DESC) != 0)
{
if (rt == -2)
- str_sprintf(buf, "update %s.\"%s\".%s set flags = bitor(flags, %Ld) where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
+ str_sprintf(buf, "update %s.\"%s\".%s set flags = bitor(flags, %ld) where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
flags,
catName.data(), quotedSchName.data(), quotedObjName.data(),
objType);
else
- str_sprintf(buf, "update %s.\"%s\".%s set redef_time = %Ld, flags = bitor(flags, %Ld) where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
+ str_sprintf(buf, "update %s.\"%s\".%s set redef_time = %ld, flags = bitor(flags, %ld) where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
redefTime,
flags,
@@ -5614,7 +5614,7 @@ short CmpSeabaseDDL::updateObjectRedefTime(
}
else if (rt != -2)
{
- str_sprintf(buf, "update %s.\"%s\".%s set redef_time = %Ld where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
+ str_sprintf(buf, "update %s.\"%s\".%s set redef_time = %ld where catalog_name = '%s' and schema_name = '%s' and object_name = '%s' and object_type = '%s' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
redefTime,
catName.data(), quotedSchName.data(), quotedObjName.data(),
@@ -5686,7 +5686,7 @@ short CmpSeabaseDDL::updateObjectName(
NAString quotedObjName;
ToQuotedString(quotedObjName, NAString(objName), FALSE);
- str_sprintf(buf, "update %s.\"%s\".%s set catalog_name = '%s', schema_name = '%s', object_name = '%s' where object_uid = %Ld ",
+ str_sprintf(buf, "update %s.\"%s\".%s set catalog_name = '%s', schema_name = '%s', object_name = '%s' where object_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
catName, quotedSchName.data(), quotedObjName.data(),
objUID);
@@ -5718,7 +5718,7 @@ short CmpSeabaseDDL::updateObjectAuditAttr(
if (objectUID < 0)
return -1;
- str_sprintf(buf, "update %s.\"%s\".%s set is_audited = '%s' where table_uid = %Ld ",
+ str_sprintf(buf, "update %s.\"%s\".%s set is_audited = '%s' where table_uid = %ld ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TABLES,
(audited ? "Y" : "N"),
objectUID);
@@ -5749,11 +5749,11 @@ short CmpSeabaseDDL::updateObjectFlags(
flags = ~inFlags;
if (reset)
- str_sprintf(buf, "update %s.\"%s\".%s set flags = bitand(flags, %Ld) where object_uid = %Ld",
+ str_sprintf(buf, "update %s.\"%s\".%s set flags = bitand(flags, %ld) where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
flags, objUID);
else
- str_sprintf(buf, "update %s.\"%s\".%s set flags = bitor(flags, %Ld) where object_uid = %Ld",
+ str_sprintf(buf, "update %s.\"%s\".%s set flags = bitor(flags, %ld) where object_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
flags, objUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -6342,7 +6342,7 @@ short CmpSeabaseDDL::updateTextTable(ExeCliInterface *cliInterface,
else
currDataLen = dataLen - currPos;
- str_sprintf(queryBuf, "insert into %s.\"%s\".%s values (%Ld, %d, %d, %d, 0, cast(? as char(%d bytes) not null))",
+ str_sprintf(queryBuf, "insert into %s.\"%s\".%s values (%ld, %d, %d, %d, 0, cast(? as char(%d bytes) not null))",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
objUID,
textType,
@@ -6386,7 +6386,7 @@ short CmpSeabaseDDL::deleteFromTextTable(ExeCliInterface *cliInterface,
Lng32 cliRC = 0;
char buf[1000];
- str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %Ld and text_type = %d and sub_id = %d",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where text_uid = %ld and text_type = %d and sub_id = %d",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_TEXT,
objUID, static_cast<int>(textType), subID);
cliRC = cliInterface->executeImmediate(buf);
@@ -7043,7 +7043,7 @@ short CmpSeabaseDDL::dropSeabaseStats(ExeCliInterface *cliInterface,
// delete any histogram statistics
- str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %ld",
catName, schName, HBASE_HIST_NAME, tableUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -7064,7 +7064,7 @@ short CmpSeabaseDDL::dropSeabaseStats(ExeCliInterface *cliInterface,
return -1;
}
- str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %Ld",
+ str_sprintf(buf, "delete from %s.\"%s\".%s where table_uid = %ld",
catName, schName, HBASE_HISTINT_NAME, tableUID);
cliRC = cliInterface->executeImmediate(buf);
@@ -7081,7 +7081,7 @@ short CmpSeabaseDDL::dropSeabaseStats(ExeCliInterface *cliInterface,
// Delete the row in the persistent_samples table if one exists
str_sprintf(buf, "select translate(sample_name using ucs2toutf8) from "
- " (delete from %s.\"%s\".%s where table_uid = %Ld) as t",
+ " (delete from %s.\"%s\".%s where table_uid = %ld) as t",
catName, schName, HBASE_PERS_SAMP_NAME, tableUID);
Lng32 len = 0;
@@ -7131,7 +7131,7 @@ short CmpSeabaseDDL::updateSeabaseVersions(
Int64 initTime = NA_JulianTimestamp();
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('METADATA', %d, %d, %Ld, 'initialize trafodion'), ('DATAFORMAT', %d, %d, %Ld, 'initialize trafodion'), ('SOFTWARE', %d, %d, %Ld, 'initialize trafodion') ",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('METADATA', %d, %d, %ld, 'initialize trafodion'), ('DATAFORMAT', %d, %d, %ld, 'initialize trafodion'), ('SOFTWARE', %d, %d, %ld, 'initialize trafodion') ",
sysCat, SEABASE_MD_SCHEMA, SEABASE_VERSIONS,
(majorVersion != -1 ? majorVersion : METADATA_MAJOR_VERSION),
(METADATA_MINOR_VERSION * 10 + METADATA_UPDATE_VERSION), initTime,
@@ -7167,7 +7167,7 @@ short CmpSeabaseDDL::updateSeabaseAuths(
Int64 initTime = NA_JulianTimestamp();
- str_sprintf(buf, "insert into %s.\"%s\".%s values (%d, 'DB__ROOT', 'TRAFODION', 'U', %d, 'Y', %Ld,%Ld, 0) ",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values (%d, 'DB__ROOT', 'TRAFODION', 'U', %d, 'Y', %ld,%ld, 0) ",
sysCat, SEABASE_MD_SCHEMA, SEABASE_AUTHS,
SUPER_USER, SUPER_USER, initTime, initTime);
cliRC = cliInterface->executeImmediate(buf);
@@ -7786,7 +7786,7 @@ void CmpSeabaseDDL::createSeabaseSequence(StmtDDLCreateSequence * createSequen
ToQuotedString(quotedSeqObjName, seqNamePart, FALSE);
Int32 objOwner = ComUser::getCurrentUser();
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld, '%s', '%s', %d, %d, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
catalogNamePart.data(), quotedSchName.data(), quotedSeqObjName.data(),
COM_SEQUENCE_GENERATOR_OBJECT_LIT,
@@ -7805,7 +7805,7 @@ void CmpSeabaseDDL::createSeabaseSequence(StmtDDLCreateSequence * createSequen
return;
}
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', %Ld, %d, %Ld, %Ld, %Ld, %Ld, '%s', %Ld, %Ld, %Ld, %Ld, %Ld, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', %ld, %d, %ld, %ld, %ld, %ld, '%s', %ld, %ld, %ld, %ld, %ld, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_SEQ_GEN,
(sgo->isExternalSG() ? COM_EXTERNAL_SG_LIT : COM_INTERNAL_SG_LIT),
seqObjUID,
@@ -7817,9 +7817,9 @@ void CmpSeabaseDDL::createSeabaseSequence(StmtDDLCreateSequence * createSequen
(sgo->getCycle() ? COM_YES_LIT : COM_NO_LIT),
sgo->getCache(),
sgo->getStartValue(),
- 0LL,
+ 0L,
createTime,
- 0LL);
+ 0L);
cliRC = cliInterface.executeImmediate(buf);
if (cliRC < 0)
@@ -7930,25 +7930,25 @@ void CmpSeabaseDDL::alterSeabaseSequence(StmtDDLCreateSequence * alterSequence
strcpy(setOptions, " set ");
if (sgo->isIncrementSpecified())
{
- str_sprintf(tmpBuf, " increment = %Ld,", sgo->getIncrement());
+ str_sprintf(tmpBuf, " increment = %ld,", sgo->getIncrement());
strcat(setOptions, tmpBuf);
}
if (sgo->isMaxValueSpecified())
{
- str_sprintf(tmpBuf, " max_value = %Ld,", sgo->getMaxValue());
+ str_sprintf(tmpBuf, " max_value = %ld,", sgo->getMaxValue());
strcat(setOptions, tmpBuf);
}
if (sgo->isMinValueSpecified())
{
- str_sprintf(tmpBuf, " min_value = %Ld,", sgo->getMinValue());
+ str_sprintf(tmpBuf, " min_value = %ld,", sgo->getMinValue());
strcat(setOptions, tmpBuf);
}
if (sgo->isCacheSpecified())
{
- str_sprintf(tmpBuf, " cache_size = %Ld,", sgo->getCache());
+ str_sprintf(tmpBuf, " cache_size = %ld,", sgo->getCache());
strcat(setOptions, tmpBuf);
}
@@ -7965,10 +7965,10 @@ void CmpSeabaseDDL::alterSeabaseSequence(StmtDDLCreateSequence * alterSequence
}
Int64 redefTime = NA_JulianTimestamp();
- str_sprintf(tmpBuf, " redef_ts = %Ld", redefTime);
+ str_sprintf(tmpBuf, " redef_ts = %ld", redefTime);
strcat(setOptions, tmpBuf);
- str_sprintf(buf, "update %s.\"%s\".%s %s where seq_uid = %Ld",
+ str_sprintf(buf, "update %s.\"%s\".%s %s where seq_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_SEQ_GEN,
setOptions,
seqUID);
@@ -8581,7 +8581,7 @@ void CmpSeabaseDDL::updateVersion()
Int64 updateTime = NA_JulianTimestamp();
- str_sprintf(queryBuf, "update %s.\"%s\".%s set major_version = %Ld, minor_version = %Ld, init_time = %Ld, comment = 'update version' where version_type = 'SOFTWARE' ",
+ str_sprintf(queryBuf, "update %s.\"%s\".%s set major_version = %ld, minor_version = %ld, init_time = %ld, comment = 'update version' where version_type = 'SOFTWARE' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_VERSIONS,
softMajorVersion, softMinorVersion,
updateTime);
@@ -10495,7 +10495,7 @@ std::string commandString;
roleList += to_string((long long int)roleIDs[i]);
}
- str_sprintf(buf, "update %s.\"%s\".%s set auth_redef_time = %Ld "
+ str_sprintf(buf, "update %s.\"%s\".%s set auth_redef_time = %ld "
"where auth_id in (%s)",
systemCatalog.c_str(), SEABASE_MD_SCHEMA, SEABASE_AUTHS,
redefTime, roleList.c_str());
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
index 4386d94..9a75d75 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLroutine.cpp
@@ -229,7 +229,7 @@ short CmpSeabaseDDL::getUsingRoutines(ExeCliInterface *cliInterface,
char buf[4000];
str_sprintf(buf, "select trim(catalog_name) || '.' || trim(schema_name) || '.' || trim(object_name), "
"object_type, object_uid from %s.\"%s\".%s T, %s.\"%s\".%s LU "
- "where LU.using_library_uid = %Ld and "
+ "where LU.using_library_uid = %ld and "
"T.object_uid = LU.used_udr_uid and T.valid_def = 'Y' ",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_OBJECTS,
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES_USAGE,
@@ -389,7 +389,7 @@ void CmpSeabaseDDL::createSeabaseLibrary(
}
char * query = new(STMTHEAP) char[1000];
- str_sprintf(query, "insert into %s.\"%s\".%s values (%Ld, '%s', %d, 0)",
+ str_sprintf(query, "insert into %s.\"%s\".%s values (%ld, '%s', %d, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
objUID,
libFileName.data(),
@@ -643,7 +643,7 @@ void CmpSeabaseDDL::alterSeabaseLibrary(StmtDDLAlterLibrary *alterLibraryNode,
char buf[2048]; // filename max length is 512. Additional bytes for long
// library names.
- str_sprintf(buf, "update %s.\"%s\".%s set library_filename = '%s' where library_uid = %Ld",
+ str_sprintf(buf, "update %s.\"%s\".%s set library_filename = '%s' where library_uid = %ld",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES,
libFileName.data(),
libUID);
@@ -808,7 +808,7 @@ void CmpSeabaseDDL::createSeabaseRoutine(
char * buf = new(STMTHEAP) char[200];
str_sprintf(buf, "select library_filename from %s.\"%s\".%s"
- " where library_uid = %Ld for read uncommitted access",
+ " where library_uid = %ld for read uncommitted access",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES, libUID);
cliRC = cliInterface.fetchRowsPrologue(buf, TRUE/*no exec*/);
@@ -1236,7 +1236,7 @@ void CmpSeabaseDDL::createSeabaseRoutine(
char * query = new(STMTHEAP) char[2000+MAX_SIGNATURE_LENGTH];
- str_sprintf(query, "insert into %s.\"%s\".%s values (%Ld, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', %Ld, '%s', 0)",
+ str_sprintf(query, "insert into %s.\"%s\".%s values (%ld, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', '%s', '%s', '%s', '%s', %ld, '%s', 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_ROUTINES,
objUID,
udrType.data(),
@@ -1267,7 +1267,7 @@ void CmpSeabaseDDL::createSeabaseRoutine(
}
char * query1 = new(STMTHEAP) char[1000];
- str_sprintf(query1, "insert into %s.\"%s\".%s values (%Ld, %Ld, 0)",
+ str_sprintf(query1, "insert into %s.\"%s\".%s values (%ld, %ld, 0)",
getSystemCatalog(), SEABASE_MD_SCHEMA, SEABASE_LIBRARIES_USAGE,
libUID, objUID);
@@ -1760,7 +1760,7 @@ short CmpSeabaseDDL::dropSeabaseLibmgr(ExeCliInterface *cliInterface)
Set_SqlParser_Flags(INTERNAL_QUERY_FROM_EXEUTIL);
str_sprintf(queryBuf, "drop schema if exists %s.\"%s\" cascade ",
- getSystemCatalog(),SEABASE_LIBMGR_SCHEMA, DB__ROOT);
+ getSystemCatalog(),SEABASE_LIBMGR_SCHEMA);
// Drop the SEABASE_LIBMGR_SCHEMA schema
cliRC = cliInterface->executeImmediate(queryBuf);
http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/8fd49879/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
----------------------------------------------------------------------
diff --git a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
index d44139c..e295c7a 100644
--- a/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
+++ b/core/sql/sqlcomp/CmpSeabaseDDLschema.cpp
@@ -188,7 +188,7 @@ char schemaObjectLit[3] = {0};
}
}
- str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %Ld, %Ld, %Ld, '%s', '%s', %d, %d, 0)",
+ str_sprintf(buf, "insert into %s.\"%s\".%s values ('%s', '%s', '%s', '%s', %ld, %ld, %ld, '%s', '%s', %d, %d, 0)",
getSystemCatalog(),SEABASE_MD_SCHEMA,SEABASE_OBJECTS,
catalogName.data(), quotedSchName.data(), quotedObjName.data(),
schemaObjectLit,
@@ -1379,7 +1379,7 @@ char buf[4000];
{
str_sprintf(buf,"UPDATE %s.\"%s\".%s "
"SET object_owner = %d "
- "WHERE object_UID = %Ld",
+ "WHERE object_UID = %ld",
getSystemCatalog(),SEABASE_MD_SCHEMA,SEABASE_OBJECTS,
newOwnerID,schemaUID);
cliRC = cliInterface.executeImmediate(buf);