コード例 #1
0
ファイル: rtnCoordSql.cpp プロジェクト: 247687009/SequoiaDB
   INT32 _rtnCoordSql::execute( CHAR *pReceiveBuffer, SINT32 packSize,
                                CHAR **ppResultBuffer, pmdEDUCB *cb,
                                MsgOpReply &replyHeader,
                                BSONObj **ppErrorObj )
   {
      INT32 rc = SDB_OK ;
      pmdKRCB *krcb = pmdGetKRCB();
      SQL_CB *sqlcb = krcb->getSqlCB() ;
      NodeID curNodeID = pmdGetNodeID() ;
      MsgHeader *header = (MsgHeader *)pReceiveBuffer;
      CHAR *sql = NULL ;
      SINT64 contextID = -1 ;
      rc = msgExtractSql( pReceiveBuffer, &sql ) ;
      if ( SDB_OK != rc )
      {
         PD_LOG( PDERROR, "failed to extract sql" ) ;
         rc = SDB_SYS ;
         goto error ;
      }

      rc = sqlcb->exec( sql, cb, contextID ) ;
   done:
      msgBuildReplyMsgHeader( replyHeader,
                              sizeof(replyHeader),
                              header->opCode,
                              rc,
                              contextID, 0, 0,
                              curNodeID,
                              header->requestID ) ;
      return rc ;
   error:
      goto done ;
   }
コード例 #2
0
ファイル: rtnCoordSql.cpp プロジェクト: Andrew8305/SequoiaDB
   INT32 _rtnCoordSql::execute( MsgHeader *pMsg,
                                pmdEDUCB *cb,
                                INT64 &contextID,
                                rtnContextBuf *buf )

   {
      INT32 rc          = SDB_OK ;
      SQL_CB *sqlcb     = pmdGetKRCB()->getSqlCB() ;
      CHAR *sql         = NULL ;

      contextID         = -1 ;

      rc = msgExtractSql( (CHAR*)pMsg, &sql ) ;
      if ( SDB_OK != rc )
      {
         PD_LOG( PDERROR, "failed to extract sql" ) ;
         rc = SDB_SYS ;
         goto error ;
      }

      // add last op info
      MON_SAVE_OP_DETAIL( cb->getMonAppCB(), pMsg->opCode,
                          "%s", sql ) ;

      rc = sqlcb->exec( sql, cb, contextID ) ;

   done:
      return rc ;
   error:
      goto done ;
   }
コード例 #3
0
ファイル: pmdProcessor.cpp プロジェクト: Niwalker/SequoiaDB
   INT32 _pmdDataProcessor::_onSQLMsg( MsgHeader *msg, INT64 &contextID )
   {
      CHAR *sql = NULL ;
      INT32 rc = SDB_OK ;
      SQL_CB *sqlcb = pmdGetKRCB()->getSqlCB() ;

      rc = msgExtractSql( (CHAR*)msg, &sql ) ;
      PD_RC_CHECK( rc, PDERROR, "Session[%s] extract sql msg failed, rc: %d",
                   getSession()->sessionName(), rc ) ;

      rc = sqlcb->exec( sql, eduCB(), contextID ) ;

   done:
      return rc ;
   error:
      goto done ;
   }