trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arvind-narain <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #799: [TRAFODION-2308]JDBC T4 support read ...
Date Thu, 03 Nov 2016 20:02:47 GMT
Github user arvind-narain commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/799#discussion_r86429324
  
    --- Diff: core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp ---
    @@ -6378,6 +6378,124 @@ odbc_SQLSrvr_FetchPerf_sme_(
     
     } // odbc_SQLSrvr_FetchPerf_sme_()
     
    +extern "C" void
    +odbc_SQLSrvr_ExtractLob_sme_(
    +    /* In    */ CEE_tag_def objtag_
    +  , /* In    */ const CEE_handle_def *call_id_
    +  , /* Out   */ odbc_SQLsrvr_ExtractLob_exc_ *exception_
    +  , /* In    */ IDL_long extractLobAPI
    +  , /* In    */ IDL_string lobHandle
    +  , /* Out   */ IDL_long_long &lobDataLen
    +  , /* Out   */ IDL_char *& lobDataValue
    +  )
    +{
    +    char LobExtractQuery[1000];
    +    char RequestError[200] = {0};
    +    SRVR_STMT_HDL  *QryLobExtractSrvrStmt = NULL;
    +
    +    if ((QryLobExtractSrvrStmt = getSrvrStmt("", TRUE)) == NULL)
    +    {
    +        SendEventMsg(MSG_MEMORY_ALLOCATION_ERROR,
    +                     EVENTLOG_ERROR_TYPE,
    +                     srvrGlobal->nskProcessInfo.processId,
    +                     ODBCMX_SERVER,
    +                     srvrGlobal->srvrObjRef,
    +                     2,
    +                     "EXTRACT LOB APIs",
    +                     "Allocate Statement");
    +        exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_;
    +        exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_UNABLE_TO_ALLOCATE_SQL_STMT;
    +    }
    +
    +    snprintf(LobExtractQuery, sizeof(LobExtractQuery), "EXTRACT LOBLENGTH(LOB'%s') LOCATION
%Ld", lobHandle, (Int64)&lobDataLen);
    +
    +    try
    +    {
    +        SQL_EXEC_SetParserFlagsForExSqlComp_Internal(INTERNAL_QUERY_FROM_EXEUTIL);
    +
    +        short retcode = QryLobExtractSrvrStmt->ExecDirect(NULL, LobExtractQuery, EXTERNAL_STMT,
TYPE_CALL, SQL_ASYNC_ENABLE_OFF, 0);
    +
    +        if (retcode == SQL_ERROR)
    +        {
    +            ERROR_DESC_def *p_buffer = QryLobExtractSrvrStmt->sqlError.errorList._buffer;
strncpy(RequestError, p_buffer->errorText, sizeof(RequestError) - 1);
    +
    +            SendEventMsg(MSG_SQL_ERROR,
    +                         EVENTLOG_ERROR_TYPE,
    +                         srvrGlobal->nskProcessInfo.processId,
    +                         ODBCMX_SERVER,
    +                         srvrGlobal->srvrObjRef,
    +                         2,
    +                         p_buffer->sqlcode,
    +                         RequestError);
    +
    +            exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_;
    +            exception_->u.SQLError.errorList._length = QryLobExtractSrvrStmt->sqlError.errorList._length;
    +            exception_->u.SQLError.errorList._buffer = QryLobExtractSrvrStmt->sqlError.errorList._buffer;
    +            exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_EXECUTE_FAILED;
    +        }
    +    }
    +    catch (...)
    +    {
    +        SendEventMsg(MSG_PROGRAMMING_ERROR,
    +                EVENTLOG_ERROR_TYPE,
    +                srvrGlobal->nskProcessInfo.processId,
    +                ODBCMX_SERVER,
    +                srvrGlobal->srvrObjRef,
    +                1,
    +                "Exception in executing EXTRACT LOBLENGTH");
    +
    +        exception_->exception_nr = odbc_SQLsrvr_ExtractLob_ParamError_exn_;
    +        exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_EXECDIRECT_FAILED;
    +    }
    +
    --- End diff --
    
    Would you like to check for exception_->exception_nr == 0 here ?


---
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