⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbdict.hpp

📁 mysql-5.0.22.tar.gz源码包
💻 HPP
📖 第 1 页 / 共 5 页
字号:
    BS_IDLE = 0,    BS_CREATE_TAB = 1,    BS_BUSY = 2,    BS_NODE_FAILURE = 3  };  BlockState c_blockState;  struct PackTable {        enum PackTableState {      PTS_IDLE = 0,      PTS_ADD_TABLE_MASTER = 1,      PTS_ADD_TABLE_SLAVE = 2,      PTS_GET_TAB = 3,      PTS_RESTART = 4    } m_state;  } c_packTable;  Uint32 c_startPhase;  Uint32 c_restartType;  bool   c_initialStart;  bool   c_systemRestart;  bool   c_nodeRestart;  bool   c_initialNodeRestart;  Uint32 c_tabinfoReceived;  /**   * Temporary structure used when parsing table info   */  struct ParseDictTabInfoRecord {    DictTabInfo::RequestType requestType;    Uint32 errorCode;    Uint32 errorLine;        SimpleProperties::UnpackStatus status;    Uint32 errorKey;    TableRecordPtr tablePtr;  };  // Operation records  /**   * Common part of operation records.  Uses KeyTable2.  Note that each   * seize/release invokes ctor/dtor automatically.   */  struct OpRecordCommon {    Uint32 key;         // key shared between master and slaves    Uint32 nextHash;    Uint32 prevHash;    Uint32 hashValue() const {      return key;    }    bool equal(const OpRecordCommon& rec) const {      return key == rec.key;    }  };  /**   * Create table record   */  struct CreateTableRecord : OpRecordCommon {    Uint32 m_senderRef;    Uint32 m_senderData;    Uint32 m_coordinatorRef;        Uint32 m_errorCode;    void setErrorCode(Uint32 c){ if(m_errorCode == 0) m_errorCode = c;}    // For alter table    Uint32 m_changeMask;    bool m_alterTableFailed;    AlterTableRef m_alterTableRef;    Uint32 m_alterTableId;    /* Previous table name (used for reverting failed table rename) */    char previousTableName[MAX_TAB_NAME_SIZE];    Uint32 m_tablePtrI;    Uint32 m_tabInfoPtrI;    Uint32 m_fragmentsPtrI;    Uint32 m_dihAddFragPtr; // Connect ptr towards DIH    Uint32 m_lqhFragPtr;    // Connect ptr towards LQH    Callback m_callback;    // Who's using local create tab    MutexHandle2<DIH_START_LCP_MUTEX> m_startLcpMutex;        struct CoordinatorData {      Uint32 m_gsn;      SafeCounterHandle m_counter;      CreateTabReq::RequestType m_requestType;    } m_coordinatorData;  };  typedef Ptr<CreateTableRecord> CreateTableRecordPtr;  /**   * Drop table record   */  struct DropTableRecord : OpRecordCommon {    DropTableReq m_request;        Uint32 m_requestType;    Uint32 m_coordinatorRef;        Uint32 m_errorCode;    void setErrorCode(Uint32 c){ if(m_errorCode == 0) m_errorCode = c;}    MutexHandle2<BACKUP_DEFINE_MUTEX> m_define_backup_mutex;        /**     * When sending stuff around     */    struct CoordinatorData {      Uint32 m_gsn;      Uint32 m_block;      SignalCounter m_signalCounter;    } m_coordinatorData;    struct ParticipantData {      Uint32 m_gsn;      Uint32 m_block;      SignalCounter m_signalCounter;      Callback m_callback;    } m_participantData;  };  typedef Ptr<DropTableRecord> DropTableRecordPtr;  /**   * Request flags passed in signals along with request type and   * propagated across operations.   */  struct RequestFlag {    enum {      RF_LOCAL = 1 << 0,        // create on local node only      RF_NOBUILD = 1 << 1,      // no need to build index      RF_NOTCTRIGGER = 1 << 2,  // alter trigger: no trigger in TC      RF_FORCE = 1 << 4         // force drop    };  };  /**   * Operation record for create index.   */  struct OpCreateIndex : OpRecordCommon {    // original request (index id will be added)    CreateIndxReq m_request;    AttributeList m_attrList;    char m_indexName[MAX_TAB_NAME_SIZE];    bool m_storedIndex;    // coordinator DICT    Uint32 m_coordinatorRef;    bool m_isMaster;    // state info    CreateIndxReq::RequestType m_requestType;    Uint32 m_requestFlag;    // error info    CreateIndxRef::ErrorCode m_lastError;    CreateIndxRef::ErrorCode m_errorCode;    Uint32 m_errorLine;    Uint32 m_errorNode;    // counters    SignalCounter m_signalCounter;    // ctor    OpCreateIndex() {      memset(&m_request, 0, sizeof(m_request));      m_coordinatorRef = 0;      m_requestType = CreateIndxReq::RT_UNDEFINED;      m_requestFlag = 0;      m_lastError = CreateIndxRef::NoError;      m_errorCode = CreateIndxRef::NoError;      m_errorLine = 0;      m_errorNode = 0;    }    void save(const CreateIndxReq* req) {      m_request = *req;      m_requestType = req->getRequestType();      m_requestFlag = req->getRequestFlag();    }    bool hasLastError() {      return m_lastError != CreateIndxRef::NoError;    }    bool hasError() {      return m_errorCode != CreateIndxRef::NoError;    }    void setError(const CreateIndxRef* ref) {      m_lastError = CreateIndxRef::NoError;      if (ref != 0) {        m_lastError = ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const CreateTableRef* ref) {      m_lastError = CreateIndxRef::NoError;      if (ref != 0) {        switch (ref->getErrorCode()) {        case CreateTableRef::TableAlreadyExist:          m_lastError = CreateIndxRef::IndexExists;          break;        default:          m_lastError = (CreateIndxRef::ErrorCode)ref->getErrorCode();          break;        }        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();        }      }    }    void setError(const AlterIndxRef* ref) {      m_lastError = CreateIndxRef::NoError;      if (ref != 0) {        m_lastError = (CreateIndxRef::ErrorCode)ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }  };  typedef Ptr<OpCreateIndex> OpCreateIndexPtr;  /**   * Operation record for drop index.   */  struct OpDropIndex : OpRecordCommon {    // original request    DropIndxReq m_request;    // coordinator DICT    Uint32 m_coordinatorRef;    bool m_isMaster;    // state info    DropIndxReq::RequestType m_requestType;    Uint32 m_requestFlag;    // error info    DropIndxRef::ErrorCode m_lastError;    DropIndxRef::ErrorCode m_errorCode;    Uint32 m_errorLine;    Uint32 m_errorNode;    // counters    SignalCounter m_signalCounter;    // ctor    OpDropIndex() {      memset(&m_request, 0, sizeof(m_request));      m_coordinatorRef = 0;      m_requestType = DropIndxReq::RT_UNDEFINED;      m_requestFlag = 0;      m_lastError = DropIndxRef::NoError;      m_errorCode = DropIndxRef::NoError;      m_errorLine = 0;      m_errorNode = 0;    }    void save(const DropIndxReq* req) {      m_request = *req;      m_requestType = req->getRequestType();      m_requestFlag = req->getRequestFlag();    }    bool hasLastError() {      return m_lastError != DropIndxRef::NoError;    }    bool hasError() {      return m_errorCode != DropIndxRef::NoError;    }    void setError(const DropIndxRef* ref) {      m_lastError = DropIndxRef::NoError;      if (ref != 0) {        m_lastError = ref->getErrorCode();        if (! hasError()) {          m_errorCode = ref->getErrorCode();          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const AlterIndxRef* ref) {      m_lastError = DropIndxRef::NoError;      if (ref != 0) {        m_lastError = (DropIndxRef::ErrorCode)ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const DropTableRef* ref) {      m_lastError = DropIndxRef::NoError;      if (ref != 0) {	switch (ref->errorCode) {	case DropTableRef::Busy:	  m_lastError = DropIndxRef::Busy;	  break;	case DropTableRef::NoSuchTable:	  m_lastError = DropIndxRef::IndexNotFound;	  break;	case DropTableRef::DropInProgress:	  m_lastError = DropIndxRef::Busy;	  break;	case DropTableRef::NoDropTableRecordAvailable:	  m_lastError = DropIndxRef::Busy;	  break;	default:	  m_lastError = (DropIndxRef::ErrorCode)ref->errorCode;	  break;	}        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = 0;          m_errorNode = 0;        }      }    }  };  typedef Ptr<OpDropIndex> OpDropIndexPtr;  /**   * Operation record for alter index.   */  struct OpAlterIndex : OpRecordCommon {    // original request plus buffer for attribute lists    AlterIndxReq m_request;    AttributeList m_attrList;    AttributeList m_tableKeyList;    // coordinator DICT    Uint32 m_coordinatorRef;    bool m_isMaster;    // state info    AlterIndxReq::RequestType m_requestType;    Uint32 m_requestFlag;    // error info    AlterIndxRef::ErrorCode m_lastError;    AlterIndxRef::ErrorCode m_errorCode;    Uint32 m_errorLine;    Uint32 m_errorNode;    // counters    SignalCounter m_signalCounter;    Uint32 m_triggerCounter;    // ctor    OpAlterIndex() {      memset(&m_request, 0, sizeof(m_request));      m_coordinatorRef = 0;      m_requestType = AlterIndxReq::RT_UNDEFINED;      m_requestFlag = 0;      m_lastError = AlterIndxRef::NoError;      m_errorCode = AlterIndxRef::NoError;      m_errorLine = 0;      m_errorNode = 0;      m_triggerCounter = 0;    }    void save(const AlterIndxReq* req) {      m_request = *req;      m_requestType = req->getRequestType();      m_requestFlag = req->getRequestFlag();    }    bool hasLastError() {      return m_lastError != AlterIndxRef::NoError;    }    bool hasError() {      return m_errorCode != AlterIndxRef::NoError;    }    void setError(const AlterIndxRef* ref) {      m_lastError = AlterIndxRef::NoError;      if (ref != 0) {        m_lastError = ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const CreateIndxRef* ref) {      m_lastError = AlterIndxRef::NoError;      if (ref != 0) {        m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const DropIndxRef* ref) {      m_lastError = AlterIndxRef::NoError;      if (ref != 0) {        m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = ref->getErrorLine();          m_errorNode = ref->getErrorNode();        }      }    }    void setError(const BuildIndxRef* ref) {      m_lastError = AlterIndxRef::NoError;      if (ref != 0) {        m_lastError = (AlterIndxRef::ErrorCode)ref->getErrorCode();        if (! hasError()) {          m_errorCode = m_lastError;          m_errorLine = 0;          m_errorNode = 0;        }      }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -