Versions in this module Expand all Collapse all v1 v1.0.4 Jul 20, 2023 v1.0.3 Jul 20, 2023 v1.0.2 Aug 3, 2022 v1.0.1 Aug 3, 2022 v1.0.0 Aug 3, 2022 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 ExtraHandleID + const ExtraPhysTblID + const ExtraPidColID + 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 + var ExtraHandleName = NewCIStr("_tidb_rowid") + var ExtraPartitionIdName = NewCIStr("_tidb_pid") + var ExtraPhysTblIdName = NewCIStr("_tidb_tid") + 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 ActionAlterSequence + const ActionAlterTableAttributes + const ActionAlterTablePartitionAttributes + const ActionAlterTablePartitionPlacement + const ActionAlterTablePlacement + const ActionAlterTableStatsOptions + const ActionCreatePlacementPolicy + 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 ActionDropSchema + const ActionDropSequence + const ActionDropTable + const ActionDropTablePartition + const ActionDropView + const ActionExchangeTablePartition + const ActionLockTable + const ActionModifyColumn + const ActionModifySchemaCharsetAndCollate + const ActionModifySchemaDefaultPlacement + const ActionModifyTableAutoIdCache + const ActionModifyTableCharsetAndCollate + const ActionModifyTableComment + const ActionMultiSchemaChange + const ActionNone + const ActionRebaseAutoID + const ActionRebaseAutoRandomBase + const ActionRecoverTable + const ActionRenameIndex + const ActionRenameTable + const ActionRenameTables + const ActionRepairTable + const ActionSetDefaultValue + const ActionSetTiFlashMode + const ActionSetTiFlashReplica + const ActionShardRowID + const ActionTruncateTable + const ActionTruncateTablePartition + const ActionUnlockTable + const ActionUpdateTiFlashReplicaStatus + func (action ActionType) String() string + type AffectedOption struct + OldSchemaID int64 + OldTableID int64 + SchemaID int64 + TableID int64 + type CIStr struct + L string + O string + func NewCIStr(s string) (cs CIStr) + 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 + 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 + RefTable CIStr + State SchemaState + func (fk *FKInfo) Clone() *FKInfo + 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 + Columns []*IndexColumn + Comment string + Global bool + ID int64 + Invisible bool + Name CIStr + Primary bool + State SchemaState + Table CIStr + Tp IndexType + Unique bool + 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 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 + 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 + 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 SchemaDiff struct + AffectedOpts []*AffectedOption + OldSchemaID int64 + OldTableID int64 + 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 + 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 TableCacheStatusType int + const TableCacheStatusDisable + const TableCacheStatusEnable + const TableCacheStatusSwitching + func (t TableCacheStatusType) String() string + type TableInfo struct + AutoIdCache int64 + AutoIncID int64 + AutoRandID int64 + AutoRandomBits 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 + MaxIndexID int64 + MaxShardRowIDBits uint64 + Name CIStr + OldSchemaID int64 + PKIsHandle bool + Partition *PartitionInfo + PlacementPolicyRef *PolicyRefInfo + PreSplitRegions uint64 + Sequence *SequenceInfo + ShardRowIDBits uint64 + State SchemaState + StatsOptions *StatsOptions + TiFlashMode TiFlashMode + 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) + 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 TiFlashMode string + const TiFlashModeFast + const TiFlashModeNormal + func (t TiFlashMode) 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