Versions in this module Expand all Collapse all v7 v7.0.4 Jan 30, 2023 v7.0.2 Jan 30, 2023 v7.0.1 Jan 30, 2023 v7.0.0 Jan 30, 2023 Changes in this version + const CurrentMagicByteVer + const MaxGlobalID + const MaxInt48 + var ErrDBExists = dbterror.ClassMeta.NewStd(mysql.ErrDBCreateExists) + var ErrDBNotExists = dbterror.ClassMeta.NewStd(mysql.ErrBadDB) + var ErrDDLReorgElementNotExist = dbterror.ClassMeta.NewStd(errno.ErrDDLReorgElementNotExist) + var ErrInvalidString = dbterror.ClassMeta.NewStd(errno.ErrInvalidCharacterString) + var ErrPolicyExists = dbterror.ClassMeta.NewStd(errno.ErrPlacementPolicyExists) + var ErrPolicyNotExists = dbterror.ClassMeta.NewStd(errno.ErrPlacementPolicyNotExists) + var ErrResourceGroupExists = dbterror.ClassMeta.NewStd(errno.ErrResourceGroupExists) + var ErrResourceGroupNotExists = dbterror.ClassMeta.NewStd(errno.ErrResourceGroupNotExists) + var ErrTableExists = dbterror.ClassMeta.NewStd(mysql.ErrTableExists) + var ErrTableNotExists = dbterror.ClassMeta.NewStd(mysql.ErrNoSuchTable) + func AutoRandomTableIDKey(tableID int64) []byte + func AutoTableIDKey(tableID int64) []byte + func BackupAndRestoreAutoIDs(m *Meta, databaseID, tableID int64, newDatabaseID, newTableID int64) (err error) + func DBkey(dbID int64) []byte + func DDLJobHistoryKey(m *Meta, jobID int64) []byte + func IsAutoRandomTableIDKey(key []byte) bool + func IsAutoTableIDKey(key []byte) bool + func IsDBkey(dbKey []byte) bool + func IsSequenceKey(key []byte) bool + func IsTableKey(tableKey []byte) bool + func ParseAutoRandomTableIDKey(key []byte) (int64, error) + func ParseAutoTableIDKey(key []byte) (int64, error) + func ParseDBKey(dbkey []byte) (int64, error) + func ParseSequenceKey(key []byte) (int64, error) + func ParseTableKey(tableKey []byte) (int64, error) + func SequenceKey(sequenceID int64) []byte + func TableKey(tableID int64) []byte + type AccessorPicker interface + IncrementID func(tableVersion uint16) AutoIDAccessor + RandomID func() AutoIDAccessor + RowID func() AutoIDAccessor + SequenceCycle func() AutoIDAccessor + SequenceValue func() AutoIDAccessor + type AutoIDAccessor interface + Del func() error + Get func() (int64, error) + Inc func(step int64) (int64, error) + Put func(val int64) error + type AutoIDAccessors interface + Del func() error + Get func() (AutoIDGroup, error) + Put func(autoIDs AutoIDGroup) error + func NewAutoIDAccessors(m *Meta, databaseID, tableID int64) AutoIDAccessors + type AutoIDGroup struct + IncrementID int64 + RandomID int64 + RowID int64 + type Element struct + ID int64 + TypeKey []byte + func DecodeElement(b []byte) (*Element, error) + func (e *Element) EncodeElement() []byte + func (e *Element) String() string + type ElementKeyType []byte + var ColumnElementKey ElementKeyType = []byte("_col_") + var IndexElementKey ElementKeyType = []byte("_idx_") + type HLastJobIterator struct + func (i *HLastJobIterator) GetLastJobs(num int, jobs []*model.Job) ([]*model.Job, error) + type JobListKeyType []byte + var AddIndexJobListKey JobListKeyType = mDDLJobAddIdxList + var DefaultJobListKey JobListKeyType = mDDLJobListKey + type LastJobIterator interface + GetLastJobs func(num int, jobs []*model.Job) ([]*model.Job, error) + type Meta struct + StartTS uint64 + func NewMeta(txn kv.Transaction) *Meta + func NewSnapshotMeta(snapshot kv.Snapshot) *Meta + func (m *Meta) AddHistoryDDLJob(job *model.Job, updateRawArgs bool) error + func (m *Meta) AdvanceGlobalIDs(n int) (int64, error) + func (m *Meta) CheckDDLTableExists() (bool, error) + func (m *Meta) CheckMDLTableExists() (bool, error) + func (m *Meta) CheckTableExists(dbID int64, tableID int64) (bool, error) + func (m *Meta) CreateDatabase(dbInfo *model.DBInfo) error + func (m *Meta) CreateMySQLDatabaseIfNotExists() (int64, error) + func (m *Meta) CreatePolicy(policy *model.PolicyInfo) error + func (m *Meta) CreateResourceGroup(group *model.ResourceGroupInfo) error + func (m *Meta) CreateSequenceAndSetSeqValue(dbID int64, tableInfo *model.TableInfo, seqValue int64) error + func (m *Meta) CreateTableAndSetAutoID(dbID int64, tableInfo *model.TableInfo, autoIncID, autoRandID int64) error + func (m *Meta) CreateTableOrView(dbID int64, tableInfo *model.TableInfo) error + func (m *Meta) DropDatabase(dbID int64) error + func (m *Meta) DropPolicy(policyID int64) error + func (m *Meta) DropResourceGroup(groupID int64) error + func (m *Meta) DropSequence(dbID int64, tblID int64) error + func (m *Meta) DropTableOrView(dbID int64, tblID int64) error + func (m *Meta) EnQueueDDLJob(job *model.Job, jobListKeys ...JobListKeyType) error + func (m *Meta) FinishBootstrap(version int64) error + func (m *Meta) GenAutoTableIDKeyValue(dbID, tableID, autoID int64) (key, value []byte) + func (m *Meta) GenGlobalID() (int64, error) + func (m *Meta) GenGlobalIDs(n int) ([]int64, error) + func (m *Meta) GenPlacementPolicyID() (int64, error) + func (m *Meta) GenSchemaVersion() (int64, error) + func (m *Meta) GenSchemaVersions(count int64) (int64, error) + func (m *Meta) GetAllDDLJobsInQueue(jobListKeys ...JobListKeyType) ([]*model.Job, error) + func (m *Meta) GetAutoIDAccessors(dbID, tableID int64) AutoIDAccessors + func (m *Meta) GetBootstrapVersion() (int64, error) + func (m *Meta) GetDatabase(dbID int64) (*model.DBInfo, error) + func (m *Meta) GetGlobalID() (int64, error) + func (m *Meta) GetHistoryDDLCount() (uint64, error) + func (m *Meta) GetHistoryDDLJob(id int64) (*model.Job, error) + func (m *Meta) GetHistoryDDLJobsIterator(startJobID int64) (LastJobIterator, error) + func (m *Meta) GetLastHistoryDDLJobsIterator() (LastJobIterator, error) + func (m *Meta) GetMetadataLock() (enable bool, isNull bool, err error) + func (m *Meta) GetPolicy(policyID int64) (*model.PolicyInfo, error) + func (m *Meta) GetPolicyID() (int64, error) + func (m *Meta) GetResourceGroup(groupID int64) (*model.ResourceGroupInfo, error) + func (m *Meta) GetSchemaDiff(schemaVersion int64) (*model.SchemaDiff, error) + func (m *Meta) GetSchemaVersion() (int64, error) + func (m *Meta) GetSchemaVersionWithNonEmptyDiff() (int64, error) + func (m *Meta) GetSystemDBID() (int64, error) + func (m *Meta) GetTable(dbID int64, tableID int64) (*model.TableInfo, error) + func (m *Meta) ListDatabases() ([]*model.DBInfo, error) + func (m *Meta) ListPolicies() ([]*model.PolicyInfo, error) + func (m *Meta) ListResourceGroups() ([]*model.ResourceGroupInfo, error) + func (m *Meta) ListTables(dbID int64) ([]*model.TableInfo, error) + func (m *Meta) RestartSequenceValue(dbID int64, tableInfo *model.TableInfo, seqValue int64) error + func (m *Meta) SetDDLTables() error + func (m *Meta) SetMDLTables() error + func (m *Meta) SetMetadataLock(b bool) error + func (m *Meta) SetSchemaDiff(diff *model.SchemaDiff) error + func (m *Meta) UpdateDatabase(dbInfo *model.DBInfo) error + func (m *Meta) UpdatePolicy(policy *model.PolicyInfo) error + func (m *Meta) UpdateResourceGroup(group *model.ResourceGroupInfo) error + func (m *Meta) UpdateTable(dbID int64, tableInfo *model.TableInfo) error Other modules containing this package github.com/lemon-mint/tidb