Versions in this module Expand all Collapse all v7 v7.0.4 Jan 30, 2023 v7.0.2 Jan 30, 2023 Changes in this version + const ColumnInfoVersion0 + const ColumnInfoVersion1 + const ColumnInfoVersion2 + const CurrLatestColumnInfoVersion + const CurrLatestTableInfoVersion + const DefaultNegativeSequenceMaxValue + const DefaultNegativeSequenceMinValue + const DefaultNegativeSequenceStartValue + const DefaultPositiveSequenceMaxValue + const DefaultPositiveSequenceMinValue + const DefaultPositiveSequenceStartValue + const DefaultSequenceCacheBool + const DefaultSequenceCacheValue + const DefaultSequenceCycleBool + const DefaultSequenceIncrementValue + const DefaultSequenceOrderBool + const EmptyColumnInfoSize + const ExtraHandleID + const ExtraPhysTblID + const ExtraPidColID + const FKVersion0 + const FKVersion1 + const FlagDividedByZeroAsWarning + const FlagIgnoreTruncate + const FlagIgnoreZeroInDate + const FlagInInsertStmt + const FlagInLoadDataStmt + const FlagInRestrictedSQL + const FlagInSelectStmt + const FlagInSetOprStmt + const FlagInUpdateOrDeleteStmt + const FlagOverflowAsWarning + const FlagPadCharToFullLength + const FlagTruncateAsWarning + const TableInfoVersion0 + const TableInfoVersion1 + const TableInfoVersion2 + const TableInfoVersion3 + const TableInfoVersion4 + const TableInfoVersion5 + var ExtraHandleName = NewCIStr("_tidb_rowid") + var ExtraPartitionIdName = NewCIStr("_tidb_pid") + var ExtraPhysTblIdName = NewCIStr("_tidb_tid") + func IsIndexPrefixCovered(tbInfo *TableInfo, index *IndexInfo, cols ...CIStr) bool + func LessDBInfo(a *DBInfo, b *DBInfo) bool + func TSConvert2Time(ts uint64) time.Time + type ActionType byte + const ActionAddCheckConstraint + const ActionAddColumn + const ActionAddColumns + const ActionAddForeignKey + const ActionAddIndex + const ActionAddPrimaryKey + const ActionAddTablePartition + const ActionAlterCacheTable + const ActionAlterCheckConstraint + const ActionAlterIndexVisibility + const ActionAlterNoCacheTable + const ActionAlterPlacementPolicy + const ActionAlterResourceGroup + const ActionAlterSequence + const ActionAlterTTLInfo + const ActionAlterTTLRemove + const ActionAlterTableAttributes + const ActionAlterTablePartitionAttributes + const ActionAlterTablePartitionPlacement + const ActionAlterTablePlacement + const ActionAlterTableStatsOptions + const ActionCreatePlacementPolicy + const ActionCreateResourceGroup + const ActionCreateSchema + const ActionCreateSequence + const ActionCreateTable + const ActionCreateTables + const ActionCreateView + const ActionDropCheckConstraint + const ActionDropColumn + const ActionDropColumns + const ActionDropForeignKey + const ActionDropIndex + const ActionDropIndexes + const ActionDropPlacementPolicy + const ActionDropPrimaryKey + const ActionDropResourceGroup + const ActionDropSchema + const ActionDropSequence + const ActionDropTable + const ActionDropTablePartition + const ActionDropView + const ActionExchangeTablePartition + const ActionFlashbackCluster + const ActionLockTable + const ActionModifyColumn + const ActionModifySchemaCharsetAndCollate + const ActionModifySchemaDefaultPlacement + const ActionModifyTableAutoIdCache + const ActionModifyTableCharsetAndCollate + const ActionModifyTableComment + const ActionMultiSchemaChange + const ActionNone + const ActionRebaseAutoID + const ActionRebaseAutoRandomBase + const ActionRecoverSchema + const ActionRecoverTable + const ActionRenameIndex + const ActionRenameTable + const ActionRenameTables + const ActionReorganizePartition + const ActionRepairTable + const ActionSetDefaultValue + const ActionSetTiFlashReplica + const ActionShardRowID + const ActionTruncateTable + const ActionTruncateTablePartition + const ActionUnlockTable + const ActionUpdateTiFlashReplicaStatus + func (action ActionType) String() string + type AddForeignKeyInfo struct + Cols []CIStr + Name CIStr + type AffectedOption struct + OldSchemaID int64 + OldTableID int64 + SchemaID int64 + TableID int64 + type BackfillMeta struct + EndInclude bool + ErrMsg string + IsUnique bool + Location *TimeZoneLocation + PhysicalTableID int64 + ReorgTp ReorgType + SQLMode mysql.SQLMode + Warnings map[errors.ErrorID]*terror.Error + WarningsCount map[errors.ErrorID]int64 + func (bm *BackfillMeta) Decode(b []byte) error + func (bm *BackfillMeta) Encode() ([]byte, error) + type BackfillState byte + const BackfillStateInapplicable + const BackfillStateMerging + const BackfillStateReadyToMerge + const BackfillStateRunning + func (s BackfillState) String() string + type CIStr struct + L string + O string + func NewCIStr(s string) (cs CIStr) + func (cis *CIStr) MemoryUsage() (sum int64) + func (cis *CIStr) UnmarshalJSON(b []byte) error + func (cis CIStr) String() string + type ChangeStateInfo struct + DependencyColumnOffset int + type ColumnChoice byte + const AllColumns + const ColumnList + const DefaultChoice + const PredicateColumns + func (s ColumnChoice) String() string + type ColumnInfo struct + Comment string + DefaultIsExpr bool + DefaultValue interface{} + DefaultValueBit []byte + Dependences map[string]struct{} + FieldType types.FieldType + GeneratedExprString string + GeneratedStored bool + Hidden bool + ID int64 + Name CIStr + Offset int + OriginDefaultValue interface{} + OriginDefaultValueBit []byte + State SchemaState + Version uint64 + func FindColumnInfo(cols []*ColumnInfo, name string) *ColumnInfo + func FindColumnInfoByID(cols []*ColumnInfo, id int64) *ColumnInfo + func NewExtraHandleColInfo() *ColumnInfo + func NewExtraPartitionIDColInfo() *ColumnInfo + func NewExtraPhysTblIDColInfo() *ColumnInfo + func (c *ColumnInfo) AddFlag(flag uint) + func (c *ColumnInfo) AndFlag(flag uint) + func (c *ColumnInfo) Clone() *ColumnInfo + func (c *ColumnInfo) DelFlag(flag uint) + func (c *ColumnInfo) GetCharset() string + func (c *ColumnInfo) GetCollate() string + func (c *ColumnInfo) GetDecimal() int + func (c *ColumnInfo) GetDefaultValue() interface{} + func (c *ColumnInfo) GetElems() []string + func (c *ColumnInfo) GetFlag() uint + func (c *ColumnInfo) GetFlen() int + func (c *ColumnInfo) GetOriginDefaultValue() interface{} + func (c *ColumnInfo) GetType() byte + func (c *ColumnInfo) GetTypeDesc() string + func (c *ColumnInfo) IsGenerated() bool + func (c *ColumnInfo) SetCharset(charset string) + func (c *ColumnInfo) SetCollate(collate string) + func (c *ColumnInfo) SetDecimal(decimal int) + func (c *ColumnInfo) SetDefaultValue(value interface{}) error + func (c *ColumnInfo) SetElems(elems []string) + func (c *ColumnInfo) SetFlag(flag uint) + func (c *ColumnInfo) SetFlen(flen int) + func (c *ColumnInfo) SetOriginDefaultValue(value interface{}) error + func (c *ColumnInfo) SetType(tp byte) + func (c *ColumnInfo) ToggleFlag(flag uint) + type ConstraintInfo struct + ConstraintCols []CIStr + Enforced bool + ExprString string + ID int64 + InColumn bool + Name CIStr + State SchemaState + Table CIStr + func (ci *ConstraintInfo) Clone() *ConstraintInfo + type DBInfo struct + Charset string + Collate string + ID int64 + Name CIStr + PlacementPolicyRef *PolicyRefInfo + State SchemaState + Tables []*TableInfo + func (db *DBInfo) Clone() *DBInfo + func (db *DBInfo) Copy() *DBInfo + type DDLReorgMeta struct + EndHandle int64 + Location *TimeZoneLocation + ReorgTp ReorgType + SQLMode mysql.SQLMode + Warnings map[errors.ErrorID]*terror.Error + WarningsCount map[errors.ErrorID]int64 + func NewDDLReorgMeta() *DDLReorgMeta + type ExchangePartitionInfo struct + ExchangePartitionDefID int64 + ExchangePartitionFlag bool + ExchangePartitionID int64 + type FKInfo struct + Cols []CIStr + ID int64 + Name CIStr + OnDelete int + OnUpdate int + RefCols []CIStr + RefSchema CIStr + RefTable CIStr + State SchemaState + Version int + func FindFKInfoByName(fks []*FKInfo, name string) *FKInfo + func (fk *FKInfo) Clone() *FKInfo + func (fk *FKInfo) String(db, tb string) string + type HistoryInfo struct + DBInfo *DBInfo + FinishedTS uint64 + MultipleTableInfos []*TableInfo + SchemaVersion int64 + TableInfo *TableInfo + func (h *HistoryInfo) AddDBInfo(schemaVer int64, dbInfo *DBInfo) + func (h *HistoryInfo) AddTableInfo(schemaVer int64, tblInfo *TableInfo) + func (h *HistoryInfo) Clean() + func (h *HistoryInfo) SetTableInfos(schemaVer int64, tblInfos []*TableInfo) + type IndexColumn struct + Length int + Name CIStr + Offset int + func FindIndexColumnByName(indexCols []*IndexColumn, nameL string) (int, *IndexColumn) + func (i *IndexColumn) Clone() *IndexColumn + type IndexInfo struct + BackfillState BackfillState + Columns []*IndexColumn + Comment string + Global bool + ID int64 + Invisible bool + MVIndex bool + Name CIStr + Primary bool + State SchemaState + Table CIStr + Tp IndexType + Unique bool + func FindIndexByColumns(tbInfo *TableInfo, indices []*IndexInfo, cols ...CIStr) *IndexInfo + func FindIndexInfoByID(indices []*IndexInfo, id int64) *IndexInfo + func (index *IndexInfo) Clone() *IndexInfo + func (index *IndexInfo) FindColumnByName(nameL string) *IndexColumn + func (index *IndexInfo) HasColumnInIndexColumns(tblInfo *TableInfo, colID int64) bool + func (index *IndexInfo) HasPrefixIndex() bool + type IndexType int + const IndexTypeBtree + const IndexTypeHash + const IndexTypeInvalid + const IndexTypeRtree + func (t IndexType) String() string + type Job struct + Args []interface{} + BinlogInfo *HistoryInfo + CtxVars []interface{} + DependencyID int64 + Error *terror.Error + ErrorCount int64 + ID int64 + Mu sync.Mutex + MultiSchemaInfo *MultiSchemaInfo + Priority int + Query string + RawArgs json.RawMessage + RealStartTS uint64 + ReorgMeta *DDLReorgMeta + RowCount int64 + SchemaID int64 + SchemaName string + SchemaState SchemaState + SeqNum uint64 + SnapshotVer uint64 + StartTS uint64 + State JobState + TableID int64 + TableName string + Type ActionType + Version int64 + Warning *terror.Error + func (job *Job) Clone() *Job + func (job *Job) Decode(b []byte) error + func (job *Job) DecodeArgs(args ...interface{}) error + func (job *Job) Encode(updateRawArgs bool) ([]byte, error) + func (job *Job) FinishDBJob(jobState JobState, schemaState SchemaState, ver int64, dbInfo *DBInfo) + func (job *Job) FinishMultipleTableJob(jobState JobState, schemaState SchemaState, ver int64, tblInfos []*TableInfo) + func (job *Job) FinishTableJob(jobState JobState, schemaState SchemaState, ver int64, tblInfo *TableInfo) + func (job *Job) GetRowCount() int64 + func (job *Job) GetWarnings() (map[errors.ErrorID]*terror.Error, map[errors.ErrorID]int64) + func (job *Job) IsCancelled() bool + func (job *Job) IsCancelling() bool + func (job *Job) IsDependentOn(other *Job) (bool, error) + func (job *Job) IsDone() bool + func (job *Job) IsFinished() bool + func (job *Job) IsQueueing() bool + func (job *Job) IsRollbackDone() bool + func (job *Job) IsRollbackable() bool + func (job *Job) IsRollingback() bool + func (job *Job) IsRunning() bool + func (job *Job) IsSynced() bool + func (job *Job) MarkNonRevertible() + func (job *Job) MayNeedReorg() bool + func (job *Job) NotStarted() bool + func (job *Job) SetRowCount(count int64) + func (job *Job) SetWarnings(warnings map[errors.ErrorID]*terror.Error, ...) + func (job *Job) String() string + type JobMeta struct + Priority int + Query string + SchemaID int64 + TableID int64 + type JobState byte + const JobStateCancelled + const JobStateCancelling + const JobStateDone + const JobStateNone + const JobStateQueueing + const JobStateRollbackDone + const JobStateRollingback + const JobStateRunning + const JobStateSynced + func (s JobState) String() string + type MultiSchemaInfo struct + AddColumns []CIStr + AddForeignKeys []AddForeignKeyInfo + AddIndexes []CIStr + AlterIndexes []CIStr + DropColumns []CIStr + DropIndexes []CIStr + ModifyColumns []CIStr + PositionColumns []CIStr + RelativeColumns []CIStr + Revertible bool + SkipVersion bool + SubJobs []*SubJob + func NewMultiSchemaInfo() *MultiSchemaInfo + type PartitionDefinition struct + Comment string + ID int64 + InValues [][]string + LessThan []string + Name CIStr + PlacementPolicyRef *PolicyRefInfo + func (ci *PartitionDefinition) Clone() PartitionDefinition + func (ci *PartitionDefinition) MemoryUsage() (sum int64) + type PartitionInfo struct + AddingDefinitions []PartitionDefinition + Columns []CIStr + Definitions []PartitionDefinition + DroppingDefinitions []PartitionDefinition + Enable bool + Expr string + Num uint64 + States []PartitionState + Type PartitionType + func (pi *PartitionInfo) Clone() *PartitionInfo + func (pi *PartitionInfo) GCPartitionStates() + func (pi *PartitionInfo) GetNameByID(id int64) string + func (pi *PartitionInfo) GetStateByID(id int64) SchemaState + func (pi *PartitionInfo) SetStateByID(id int64, state SchemaState) + type PartitionState struct + ID int64 + State SchemaState + type PartitionType int + const PartitionTypeHash + const PartitionTypeKey + const PartitionTypeList + const PartitionTypeRange + const PartitionTypeSystemTime + func (p PartitionType) String() string + type PlacementSettings struct + Constraints string + FollowerConstraints string + Followers uint64 + LeaderConstraints string + LearnerConstraints string + Learners uint64 + PrimaryRegion string + Regions string + Schedule string + VoterConstraints string + Voters uint64 + func (p *PlacementSettings) Clone() *PlacementSettings + func (p *PlacementSettings) String() string + type PolicyInfo struct + ID int64 + Name CIStr + State SchemaState + func (p *PolicyInfo) Clone() *PolicyInfo + type PolicyRefInfo struct + ID int64 + Name CIStr + type PrimaryKeyType int8 + const PrimaryKeyTypeClustered + const PrimaryKeyTypeDefault + const PrimaryKeyTypeNonClustered + func (p PrimaryKeyType) String() string + type ReferOptionType int + const ReferOptionCascade + const ReferOptionNoAction + const ReferOptionNoOption + const ReferOptionRestrict + const ReferOptionSetDefault + const ReferOptionSetNull + func (r ReferOptionType) String() string + type ReferredFKInfo struct + ChildFKName CIStr + ChildSchema CIStr + ChildTable CIStr + Cols []CIStr + type ReorgType int8 + const ReorgTypeLitMerge + const ReorgTypeNone + const ReorgTypeTxn + const ReorgTypeTxnMerge + func (tp ReorgType) NeedMergeProcess() bool + func (tp ReorgType) String() string + type ResourceGroupInfo struct + ID int64 + Name CIStr + State SchemaState + func (p *ResourceGroupInfo) Clone() *ResourceGroupInfo + type ResourceGroupRefInfo struct + ID int64 + Name CIStr + type ResourceGroupSettings struct + CPULimiter string + IOReadBandwidth string + IOWriteBandwidth string + RRURate uint64 + WRURate uint64 + func (p *ResourceGroupSettings) Clone() *ResourceGroupSettings + func (p *ResourceGroupSettings) String() string + type SchemaDiff struct + AffectedOpts []*AffectedOption + OldSchemaID int64 + OldTableID int64 + RegenerateSchemaMap bool + SchemaID int64 + TableID int64 + Type ActionType + Version int64 + type SchemaState byte + const StateDeleteOnly + const StateDeleteReorganization + const StateGlobalTxnOnly + const StateNone + const StatePublic + const StateReplicaOnly + const StateWriteOnly + const StateWriteReorganization + func (s SchemaState) String() string + type SequenceInfo struct + Cache bool + CacheValue int64 + Comment string + Cycle bool + Increment int64 + MaxValue int64 + MinValue int64 + Start int64 + type SessionInfo struct + ServerID string + SessionID uint64 + func (s SessionInfo) String() string + type StatsOptions struct + AutoRecalc bool + Buckets uint64 + ColumnChoice ColumnChoice + ColumnList []CIStr + Concurrency uint + SampleNum uint64 + SampleRate float64 + TopN uint64 + func NewStatsOptions() *StatsOptions + type StatsWindowSettings struct + RepeatInterval uint + RepeatType WindowRepeatType + WindowEnd time.Time + WindowStart time.Time + type SubJob struct + Args []interface{} + CtxVars []interface{} + RawArgs json.RawMessage + ReorgTp ReorgType + Revertible bool + RowCount int64 + SchemaState SchemaState + SchemaVer int64 + SnapshotVer uint64 + State JobState + Type ActionType + Warning *terror.Error + func (sub *SubJob) FromProxyJob(proxyJob *Job, ver int64) + func (sub *SubJob) IsFinished() bool + func (sub *SubJob) IsNormal() bool + func (sub *SubJob) ToProxyJob(parentJob *Job) Job + type TTLInfo struct + ColumnName CIStr + Enable bool + IntervalExprStr string + IntervalTimeUnit int + JobInterval string + func (t *TTLInfo) Clone() *TTLInfo + type TableCacheStatusType int + const TableCacheStatusDisable + const TableCacheStatusEnable + const TableCacheStatusSwitching + func (t TableCacheStatusType) String() string + type TableInfo struct + AutoIdCache int64 + AutoIncID int64 + AutoRandID int64 + AutoRandomBits uint64 + AutoRandomRangeBits uint64 + Charset string + Collate string + Columns []*ColumnInfo + Comment string + CommonHandleVersion uint16 + Compression string + Constraints []*ConstraintInfo + ExchangePartitionInfo *ExchangePartitionInfo + ForeignKeys []*FKInfo + ID int64 + Indices []*IndexInfo + IsColumnar bool + IsCommonHandle bool + Lock *TableLockInfo + MaxColumnID int64 + MaxConstraintID int64 + MaxForeignKeyID int64 + MaxIndexID int64 + MaxShardRowIDBits uint64 + Name CIStr + OldSchemaID int64 + PKIsHandle bool + Partition *PartitionInfo + PlacementPolicyRef *PolicyRefInfo + PreSplitRegions uint64 + Sequence *SequenceInfo + ShardRowIDBits uint64 + State SchemaState + StatsOptions *StatsOptions + TTLInfo *TTLInfo + TiFlashReplica *TiFlashReplicaInfo + UpdateTS uint64 + Version uint16 + View *ViewInfo + func (t *TableInfo) ClearPlacement() + func (t *TableInfo) Clone() *TableInfo + func (t *TableInfo) Cols() []*ColumnInfo + func (t *TableInfo) ColumnIsInIndex(c *ColumnInfo) bool + func (t *TableInfo) ContainsAutoRandomBits() bool + func (t *TableInfo) FindColumnNameByID(id int64) string + func (t *TableInfo) FindConstraintInfoByName(constrName string) *ConstraintInfo + func (t *TableInfo) FindIndexByName(idxName string) *IndexInfo + func (t *TableInfo) FindIndexNameByID(id int64) string + func (t *TableInfo) FindPartitionDefinitionByName(partitionDefinitionName string) *PartitionDefinition + func (t *TableInfo) FindPublicColumnByName(colNameL string) *ColumnInfo + func (t *TableInfo) GetAutoIncrementColInfo() *ColumnInfo + func (t *TableInfo) GetDBID(dbID int64) int64 + func (t *TableInfo) GetPartitionInfo() *PartitionInfo + func (t *TableInfo) GetPkColInfo() *ColumnInfo + func (t *TableInfo) GetPkName() CIStr + func (t *TableInfo) GetPrimaryKey() *IndexInfo + func (t *TableInfo) GetUpdateTime() time.Time + func (t *TableInfo) HasClusteredIndex() bool + func (t *TableInfo) IsAutoIncColUnsigned() bool + func (t *TableInfo) IsAutoRandomBitColUnsigned() bool + func (t *TableInfo) IsBaseTable() bool + func (t *TableInfo) IsLocked() bool + func (t *TableInfo) IsSequence() bool + func (t *TableInfo) IsView() bool + func (t *TableInfo) MoveColumnInfo(from, to int) + func (t *TableInfo) SepAutoInc() bool + type TableItemID struct + ID int64 + IsIndex bool + TableID int64 + type TableLockInfo struct + Sessions []SessionInfo + State TableLockState + TS uint64 + Tp TableLockType + type TableLockState byte + const TableLockStateNone + const TableLockStatePreLock + const TableLockStatePublic + func (t TableLockState) String() string + type TableLockTpInfo struct + SchemaID int64 + TableID int64 + Tp TableLockType + type TableLockType byte + const TableLockNone + const TableLockRead + const TableLockReadLocal + const TableLockReadOnly + const TableLockWrite + const TableLockWriteLocal + func (t TableLockType) String() string + type TempTableType byte + const TempTableGlobal + const TempTableLocal + const TempTableNone + func (t TempTableType) String() string + type TiFlashReplicaInfo struct + Available bool + AvailablePartitionIDs []int64 + Count uint64 + LocationLabels []string + func (tr *TiFlashReplicaInfo) IsPartitionAvailable(pid int64) bool + type TimeZoneLocation struct + Name string + Offset int + func (tz *TimeZoneLocation) GetLocation() (*time.Location, error) + type ViewAlgorithm int + const AlgorithmMerge + const AlgorithmTemptable + const AlgorithmUndefined + func (v *ViewAlgorithm) String() string + type ViewCheckOption int + const CheckOptionCascaded + const CheckOptionLocal + func (v *ViewCheckOption) String() string + type ViewInfo struct + Algorithm ViewAlgorithm + CheckOption ViewCheckOption + Cols []CIStr + Definer *auth.UserIdentity + Security ViewSecurity + SelectStmt string + type ViewSecurity int + const SecurityDefiner + const SecurityInvoker + func (v *ViewSecurity) String() string + type WindowRepeatType byte + const Day + const Month + const Never + const Week + func (s WindowRepeatType) String() string