trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DaveBirdsall <...@git.apache.org>
Subject [GitHub] trafodion pull request #1428: [TRAFODION-2874] New syntax to retrieve the LO...
Date Tue, 06 Feb 2018 19:46:04 GMT
Github user DaveBirdsall commented on a diff in the pull request:

    https://github.com/apache/trafodion/pull/1428#discussion_r166421248
  
    --- Diff: core/sql/exp/ExpLOBaccess.cpp ---
    @@ -870,6 +870,67 @@ Ex_Lob_Error ExLob::getLength(char *handleIn, Int32 handleInLen,Int64
&outLobLen
           }
       return err;
     }
    +Ex_Lob_Error ExLob::getOffset(char *handleIn, Int32 handleInLen,Int64 &outLobOffset,LobsSubOper
so, Int64 transId)
    +{
    +  char logBuf[4096];
    +  Int32 cliErr = 0;
    +  Ex_Lob_Error err=LOB_OPER_OK; 
    +  char *blackBox = new(getLobGlobalHeap()) char[MAX_LOB_FILE_NAME_LEN+6];
    +  Int32 blackBoxLen = 0;
    +  Int64 dummy = 0;
    +  Int32 dummy2 = 0;
    +  if (so != Lob_External_File)
    +    {
    +      
    +      cliErr = SQL_EXEC_LOBcliInterface(handleIn, handleInLen,NULL,NULL,NULL,NULL,LOB_CLI_SELECT_LOBOFFSET,LOB_CLI_ExecImmed,&outLobOffset,0,
0, 0,0,transId,lobTrace_);
    +    
    +      if (cliErr < 0 ) {
    +        str_sprintf(logBuf,"CLI SELECT_LOBOFFSET returned error %d",cliErr);
    +        lobDebugInfo(logBuf, 0,__LINE__,lobTrace_);
    +  
    +        return LOB_DESC_READ_ERROR;
    +      }
    +    }
    + 
    +  return err;
    +}
    +
    +Ex_Lob_Error ExLob::getFileName(char *handleIn, Int32 handleInLen, char *outFileName,
Int32 &outFileLen , LobsSubOper so, Int64 transId)
    +{
    +  char logBuf[4096];
    +  Int32 cliErr = 0;
    +  Ex_Lob_Error err=LOB_OPER_OK; 
    +  Int64 dummy = 0;
    +  Int32 dummy2 = 0;
    +  if (so != Lob_External_File)
    +    {
    +      //Derive the filename from the LOB handle and return
    +      str_cpy_all(outFileName, (char *)lobDataFile_.data(),lobDataFile_.length());
    --- End diff --
    
    Do we know that the outFileName buffer is long enough?


---

Mime
View raw message