Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/799#discussion_r86425065
  
    --- Diff: core/conn/odbc/src/odbc/nsksrvr/Interface/marshalingsrvr_srvr.cpp 
---
    @@ -2300,3 +2300,89 @@ MxoSrvr_ValidateToken_param_res_(
        return CEE_SUCCESS;
     
     } // MxoSrvr_ValidateToken_param_res_()
    +
    +CEE_status
    +odbc_SQLsrvr_ExtractLob_param_res_(
    +        CInterface * pnode
    +      , char* &buffer
    +      , UInt32& message_length
    +      , const struct odbc_SQLsrvr_ExtractLob_exc_ *exception_
    +      , IDL_long_long lobDataLen
    +      , IDL_char * lobDataValue
    +)
    +{
    +    IDL_long wlength = 0;
    +    char* curptr;
    +
    +    IDL_long exceptionLength = 0;
    +    wlength += sizeof(HEADER);
    +
    +    // calculate length of the buffer for each parameter
    +
    +    // length of odbc_SQLsrvr_ExtractLob_exc_
    +    wlength += sizeof(exception_->exception_nr);
    +    wlength += sizeof(exception_->exception_detail);
    +
    +    switch(exception_->exception_nr)
    +    {
    +        case odbc_SQLsrvr_ExtractLob_ParamError_exn_:
    +            wlength += sizeof(exceptionLength);
    +            if (exception_->u.ParamError.ParamDesc != NULL)
    +            {
    +                exceptionLength = 
strlen(exception_->u.ParamError.ParamDesc) + 1;
    +                wlength += exceptionLength;
    +            }
    +            break;
    +        case odbc_SQLSrvr_ExtractLob_SQLError_exn_:
    +            ERROR_DESC_LIST_length((ERROR_DESC_LIST_def 
*)&exception_->u.SQLError.errorList, wlength);
    +            break;
    +        case odbc_SQLsrvr_ExtractLob_InvalidConnection_exn_:
    +        case odbc_SQLSrvr_ExtractLob_SQLInvalidhandle_exn_:
    +            break;
    +        default:
    +            break;
    +    }
    +
    +    // length of IDL_long  LOB len
    +    wlength += sizeof(IDL_long);
    +    if (lobDataValue != NULL)
    +    {
    +        wlength += lobDataLen;
    +    }
    +    wlength += lobDataLen;
    +
    +    // update the length of message
    +    message_length = wlength;
    +
    +    buffer = pnode->w_allocate(message_length);
    --- End diff --
    
    You may want to return CEE_ALLOCFAIL if buffer is NULL.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to