trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request: Support for [TRAFODION-1891] and...
Date Tue, 19 Apr 2016 22:54:34 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/438#discussion_r60326346
  
    --- Diff: core/sql/executor/ExExeUtilGet.cpp ---
    @@ -6116,4 +6116,588 @@ short ExExeUtilRegionStatsFormatTcb::work()
       return WORK_OK;
     }
     
    +
    +///////////////////////////////////////////////////////////////////
    +ex_tcb * ExExeUtilLobInfoTdb::build(ex_globals * glob)
    +{
    +
    +  if (isTableFormat())
    +    {
    +      ExExeUtilLobInfoTableTcb *exe_util_tcb = new(glob->getSpace()) ExExeUtilLobInfoTableTcb(*this,glob);
    +      exe_util_tcb->registerSubtasks();
    +
    +      return (exe_util_tcb);
    +    }
    +  else
    +    {
    +
    +
    +    ExExeUtilLobInfoTcb *exe_util_tcb = new(glob->getSpace()) ExExeUtilLobInfoTcb(*this,
glob);
    +    exe_util_tcb->registerSubtasks();
    +
    +    return (exe_util_tcb);
    +    }
    + 
    +}
    +
    +////////////////////////////////////////////////////////////////
    +// Constructor for class ExExeUtilLobInfoTcb
    +///////////////////////////////////////////////////////////////
    +ExExeUtilLobInfoTcb::ExExeUtilLobInfoTcb(
    +     const ComTdbExeUtilLobInfo & exe_util_tdb,
    +     ex_globals * glob)
    +     : ExExeUtilTcb( exe_util_tdb, NULL, glob)
    +{
    +  
    +
    +  inputNameBuf_ = NULL;
    +  if (exe_util_tdb.inputExpr_)
    +    {
    +      inputNameBuf_ = new(glob->getDefaultHeap()) char[exe_util_tdb.inputRowlen_];
    +    }
    +
    +  tableName_ = new(glob->getDefaultHeap()) char[2000];
    +  currLobNum_ = 1;
    +  step_ = INITIAL_;
    +}
    +
    +ExExeUtilLobInfoTcb::~ExExeUtilLobInfoTcb()
    +{
    +  if (tableName_)
    +    NADELETEBASIC(tableName_, getGlobals()->getDefaultHeap());
    +  if(inputNameBuf_) 
    +     NADELETEBASIC(inputNameBuf_, getGlobals()->getDefaultHeap());
    + 
    +  tableName_ = NULL;
    +  inputNameBuf_ = NULL;
    +}
    +
    +short ExExeUtilLobInfoTcb::collectAndReturnLobInfo(char * tableName,Int32 currLobNum,
ContextCli *currContext)
    +{
    +  char *catName = NULL;
    +  char *schName = NULL;
    +  char *objName = NULL;
    +  Int32 offset = 0;
    +  char columnName[LOBINFO_MAX_FILE_LEN]= {'\0'};
    +  char lobLocation[LOBINFO_MAX_FILE_LEN]={'\0'};
    +  char lobDataFilePath[LOBINFO_MAX_FILE_LEN]={'\0'};
    +  Int64 lobEOD=0;
    +
    +  char buf[1000];
    +  short rc = 0;
    +  if (isUpQueueFull(5))
    +    {
    +      return WORK_CALL_AGAIN; // come back later
    +    }
    +  
    +
    +  // populate catName, schName, objName.
    +  if (extractParts(tableName,
    +                   &catName, &schName, &objName))
    +    {
    +      return -1;
    +    }
    +  str_pad(buf,1000,' ');
    --- End diff --
    
    Use sizeof(buf) instead of 1000 to be more robust


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message