trafodion-codereview mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xwq <...@git.apache.org>
Subject [GitHub] incubator-trafodion pull request #799: [TRAFODION-2308]JDBC T4 support read ...
Date Tue, 08 Nov 2016 09:00:50 GMT
Github user xwq commented on a diff in the pull request:

    https://github.com/apache/incubator-trafodion/pull/799#discussion_r86946823
  
    --- 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);
    +
    --- End diff --
    
    Hi, Arvind.
    
    I'm not quite understand the parser flag. I'm not sure do we really need set the flag
to INTERNAL_QUERY_FROM_EXECUTIL here. 
    
    When catalog query is executed , it need set the flag to INTERAL_QUERY_FROM_EXEUTIL to
bypasss checks on metadata tables. Here it looks we can skip set the flag.  


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