package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev
# Functions
FillRollBackArgsForAddColumn fills the args for rollback add column ddl.
FillRollbackArgsForAddPartition fills the rollback args for add partition job.
FindColumnInfo finds ColumnInfo in cols by name.
FindColumnInfoByID finds ColumnInfo in cols by id.
FindFKInfoByName finds FKInfo in fks by lowercase name.
FindIndexByColumns find IndexInfo in indices which is cover the specified columns.
FindIndexColumnByName finds IndexColumn by name.
FindIndexInfoByID finds IndexInfo in indices by id.
GetAddCheckConstraintArgs gets the AddCheckConstraint args.
GetAddForeignKeyArgs get the args for AddForeignKey ddl.
GetAlterIndexVisibilityArgs gets the args for AlterIndexVisibility ddl.
GetAlterSequenceArgs gets the args for alter Sequence ddl job.
GetAlterTableAttributesArgs get alter table attribute args from job.
GetAlterTablePartitionArgs gets the alter table partition args.
GetAlterTablePlacementArgs gets the args for alter table placements ddl job.
GetAlterTTLInfoArgs gets the args for alter ttl info job.
GetBatchCreateTableArgs gets the batch create-table args.
GetCheckConstraintArgs gets the AlterCheckConstraint args.
GetCreateSchemaArgs gets the args for create schema job.
GetCreateTableArgs gets the create-table args.
GetDropForeignKeyArgs gets the args for DropForeignKey ddl.
GetDropIndexArgs is only used to get drop index arg.
GetDropSchemaArgs gets the args for drop schema job.
GetDropTableArgs gets the drop-table args.
GetExchangeTablePartitionArgs gets the exchange table partition args.
GetFinishedDropSchemaArgs gets the args for drop schema job after the job is finished.
GetFinishedDropTableArgs gets the drop-table args after the job is finished.
GetFinishedModifyColumnArgs get the finished modify column argument from job.
GetFinishedModifyIndexArgs gets the add/drop index args.
GetFinishedTablePartitionArgs gets the table partition args after the job is finished.
GetFinishedTruncateTableArgs gets the truncate table args after the job is finished.
GetFlashbackClusterArgs get the flashback cluster argument from job.
GetJobVerInUse returns the version of DDL job used in the node.
GetLockTablesArgs get the LockTablesArgs argument.
GetModifyColumnArgs get the modify column argument from job.
GetModifyIndexArgs gets the add/rename index args.
GetModifySchemaArgs gets the modify schema args.
GetModifyTableAutoIDCacheArgs gets the args for modify table autoID cache ddl job.
GetModifyTableCharsetAndCollateArgs gets the args for ActionModifyTableCharsetAndCollate ddl.
GetModifyTableCommentArgs gets the args for ActionModifyTableComment.
GetPlacementPolicyArgs gets the placement policy args.
GetRebaseAutoIDArgs the args for ActionRebaseAutoID/ActionRebaseAutoRandomBase ddl.
GetRecoverArgs get the recover table/schema args.
GetRenameTableArgs get the arguments from job.
GetRenameTablesArgs gets the rename-tables args.
GetRenameTablesArgsFromV1 get v2 args from v1.
GetRepairTableArgs get the repair table args.
GetResourceGroupArgs gets the resource group args.
GetSetDefaultValueArgs get the args for setting default value ddl.
GetSetTiFlashReplicaArgs gets the args for setting TiFlash replica ddl.
GetShardRowIDArgs gets the args for shard row ID ddl job.
GetTableColumnArgs gets the args for dropping column ddl or Adding column ddl.
GetTablePartitionArgs gets the table partition args.
GetTruncateTableArgs gets the truncate table args.
GetUpdateTiFlashReplicaStatusArgs gets the args for updating TiFlash replica status ddl.
IsIndexPrefixCovered checks the index's columns beginning with the cols.
LessDBInfo is used for sorting DBInfo by DBInfo.Name.
NewExtraHandleColInfo mocks a column info for extra handle column.
NewExtraPhysTblIDColInfo mocks a column info for extra partition id column.
NewJobW creates a new JobW.
NewMultiSchemaInfo new a MultiSchemaInfo.
NewResourceGroupSettings creates a new ResourceGroupSettings.
NewStatsOptions creates a new StatsOptions.
SetJobVerInUse sets the version of DDL job used in the node.
StrToJobState converts string to JobState.
TSConvert2Time converts timestamp to time.
# Constants
List DDL actions.
List DDL actions.
Deprecated, we use ActionMultiSchemaChange instead.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
not used.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
Deprecated, we use ActionMultiSchemaChange instead.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
List DDL actions.
AdminCommandByEndUser indicates that the Cancel/Pause/Resume command on DDL job is issued by the end user.
AdminCommandByNotKnown indicates that unknow calling of the Cancel/Pause/Resume on DDL job.
AdminCommandBySystem indicates that the Cancel/Pause/Resume command on DDL job is issued by TiDB itself, such as Upgrade(bootstrap).
BackfillStateInapplicable means the backfill-merge process is not used.
BackfillStateMerging is the state that the temp index is merging back to the origin index.
BackfillStateReadyToMerge is the state that the temporary index's records are ready to be merged back to the origin index.
BackfillStateRunning is the state that the backfill process is running.
ColumnInfoVersion0 means the column info version is 0.
ColumnInfoVersion1 means the column info version is 1.
ColumnInfoVersion2 means the column info version is 2.
CurrentReorgMetaVersion is the current version of DDLReorgMeta.
CurrLatestColumnInfoVersion means the latest column info in the current TiDB.
CurrLatestTableInfoVersion means the latest table info in the current TiDB.
WindowRepeatType values.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
Some constants for sequence.
DefaultTTLJobInterval is the default interval of TTL jobs.
DistanceMetricCosine is cosine distance.
DistanceMetricInnerProduct is inner product.
Note: tipb.VectorDistanceMetric's enum names must be aligned with these constant values.
EmptyColumnInfoSize is the memory usage of ColumnInfoSize.
ExclusiveInvolving is the default value to keep compatibility with old versions.
ExtraHandleID is the column ID of column which we need to append to schema to occupy the handle's position for use of execution phase.
ExtraPhysTblID is the column ID of column that should be filled in with the physical table id.
ExtraRowChecksumID is the column ID of column which holds the row checksum info.
FKVersion0 indicate the FKInfo version is 0.
FKVersion1 indicate the FKInfo version is 1.
FlagDividedByZeroAsWarning indicates if DividedByZero should be returned as warning.
FlagIgnoreTruncate indicates if truncate error should be ignored.
FlagIgnoreZeroInDate indicates if ZeroInDate error should be ignored.
FlagInInsertStmt indicates if this is a INSERT statement.
FlagInLoadDataStmt indicates if this is a LOAD DATA statement.
FlagInRestrictedSQL indicates if this request is in a restricted SQL.
FlagInSelectStmt indicates if this is a SELECT statement.
FlagInSetOprStmt indicates if this is a UNION/EXCEPT/INTERSECT statement.
FlagInUpdateOrDeleteStmt indicates if this is a UPDATE statement or a DELETE statement.
FlagOverflowAsWarning indicates if overflow error should be returned as warning.
FlagPadCharToFullLength indicates if sql_mode 'PAD_CHAR_TO_FULL_LENGTH' is set.
FlagTruncateAsWarning indicates if truncate error should be returned as warning.
InvolvingAll means all schemas/tables are affected.
InvolvingNone means no schema/table is affected.
JobStateCancelled is the state to do the job is cancelled, this state only persisted to history table and queue too.
JobStateCancelling is used to mark the DDL job is cancelled by the client, but the DDL worker hasn't handled it.
List job states.
List job states.
List job states.
List job states.
JobStateQueueing means the job has not yet been started.
List job states.
JobStateRollingback is the state to do the rolling back job.
List job states.
JobStateSynced means the job is done and has been synchronized to all servers.
JobVersion1 is the first version of DDL job where job args are stored as un-typed array.
JobVersion2 is the second version of DDL job where job args are stored as typed structs, we start to use this version from v8.4.0.
WindowRepeatType values.
WindowRepeatType values.
OldDefaultTTLJobInterval is the default interval of TTL jobs in v8.5 and the previous versions.
List op types.
List op types.
List op types.
ReorgMetaVersion0 is the minimum version of DDLReorgMeta.
ReorgTypeLitMerge means the index records are backfill with lightning.
ReorgTypeNone means the backfill task is not started yet.
ReorgTypeTxn means the index records are backfill with transactions.
ReorgTypeTxnMerge means backfill with transactions and merge incremental changes.
SafeDDL means the DDL can be executed by user when cluster is Primary.
ExclusiveInvolving and SharedInvolving are considered like the exclusive lock and shared lock when calculate DDL job dependencies.
StateDeleteOnly means we can only delete items for this schema element.
StateDeleteReorganization means we are re-organizing whole data after delete only state.
StateGlobalTxnOnly means we can only use global txn for operator on this schema element.
StateNone means this schema element is absent and can't be used.
StatePublic means this schema element is ok for all write and read operations.
StateReplicaOnly means we're waiting tiflash replica to be finished.
StateWriteOnly means we can use any write operation on this schema element, but outer can't read the changed data.
StateWriteReorganization means we are re-organizing whole data after write only state.
TableCacheStatusType values.
TableCacheStatusType values.
TableCacheStatusType values.
TableInfoVersion0 means the table info version is 0.
TableInfoVersion1 means the table info version is 1.
TableInfoVersion2 means the table info version is 2.
TableInfoVersion3 means the table info version is 3.
TableInfoVersion4 is not used.
TableInfoVersion5 indicates that the auto_increment allocator in TiDB has been separated from _tidb_rowid allocator when AUTO_ID_CACHE is 1.
TableLockStateNone means this table lock is absent.
TableLockStatePreLock means this table lock is pre-lock state.
TableLockStatePublic means this table lock is public state.
TempTableType values.
TempTableType values.
TempTableType values.
UnknownDDL means the DDL is unknown.
UnmanagementDDL means the DDL can't be synced by CDC.
UnsafeDDL means the DDL can't be executed by user when cluster is Primary/Secondary.
WindowRepeatType values.
# Variables
ActionBDRMap is the map of DDL ActionType to DDLBDRType.
ActionMap is the map of DDL ActionType to string.
BDRActionMap is the map of DDLBDRType to ActionType (reversed from ActionBDRMap).
ExtraHandleName is the name of ExtraHandle Column.
ExtraPhysTblIDName is the name of ExtraPhysTblID Column.
IndexableDistanceMetricToFnName maps a distance metric to the distance function name.
IndexableFnNameToDistanceMetric maps a distance function name to the distance metric.
# Structs
AddCheckConstraintArgs is the args for add check constraint.
AddForeignKeyArgs is the arguments for ActionAddForeignKey ddl.
AddForeignKeyInfo contains foreign key information.
AffectedOption is used when a ddl affects multi tables.
AlterIndexVisibilityArgs is the arguments for ActionAlterIndexVisibility ddl.
AlterSequenceArgs is the arguments for alter sequence ddl job.
AlterTableAttributesArgs is the argument for alter table attributes.
AlterTablePartitionArgs is the arguments for alter table partition job.
AlterTablePlacementArgs is the arguments for alter table placements ddl job.
AlterTTLInfoArgs is the arguments for alter ttl info job.
AutoIDGroup represents a group of auto IDs of a specific table.
BackfillMeta is meta info of the backfill job.
BatchCreateTableArgs is the arguments for batch create table job.
ChangeStateInfo is used for recording the information of schema changing.
CheckConstraintArgs is the arguments for both AlterCheckConstraint and DropCheckConstraint job.
ColumnInfo provides meta data describing of a table column.
ConstraintInfo provides meta data describing check-expression constraint.
CreateSchemaArgs is the arguments for create schema job.
CreateTableArgs is the arguments for create table/view/sequence job.
DBInfo provides meta data describing a DB.
DDLReorgMeta is meta info of DDL reorganization.
DropForeignKeyArgs is the arguments for DropForeignKey ddl.
DropSchemaArgs is the arguments for drop schema job.
DropTableArgs is the arguments for drop table/view/sequence job.
EmptyArgs is the args for ddl job with no args.
ExchangePartitionInfo provides exchange partition info.
ExchangeTablePartitionArgs is the arguments for exchange table partition job.
FKInfo provides meta data describing a foreign key constraint.
FlashbackClusterArgs is the argument for flashback cluster.
HistoryInfo is used for binlog.
IndexArg is the argument for single add/drop/rename index operation.
IndexArgSplitOpt is a field of IndexArg used by index presplit.
IndexColumn provides index column info.
IndexInfo provides meta data describing a DB index.
InvolvingSchemaInfo returns the schema info involved in the job.
Job is for a DDL operation.
JobMeta is meta info of Job.
JobW is a wrapper of model.Job, it contains the job and the binary representation of the job.
KeyRange is copied from kv.KeyRange to avoid cycle import.
LockTablesArgs is the argument for LockTables.
ModifyColumnArgs is the argument for modify column.
ModifyIndexArgs is the argument for add/drop/rename index jobs, which includes PK and vector index.
ModifySchemaArgs is the arguments for modify schema job.
ModifyTableAutoIDCacheArgs is the arguments for Modify Table AutoID Cache ddl job.
ModifyTableCharsetAndCollateArgs is the arguments for ActionModifyTableCharsetAndCollate ddl.
ModifyTableCommentArgs is the arguments for ActionModifyTableComment ddl.
MultiSchemaInfo keeps some information for multi schema change.
PartitionDefinition defines a single partition.
PartitionInfo provides table partition info.
PartitionState is the state of the partition.
PlacementPolicyArgs is the argument for create/alter/drop placement policy.
PlacementSettings is the settings of the placement.
PolicyInfo is the struct to store the placement policy.
PolicyRefInfo is the struct to refer the placement policy.
RebaseAutoIDArgs is the arguments for ActionRebaseAutoID DDL.
RecoverArgs is the argument for recover table/schema.
RecoverSchemaInfo contains information needed by DDL.RecoverSchema.
RecoverTableInfo contains information needed by DDL.RecoverTable.
ReferredFKInfo provides the cited foreign key in the child table.
RenameTableArgs is the arguments for rename table DDL job.
RenameTablesArgs is the arguments for rename tables job.
RepairTableArgs is the argument for repair table.
ResourceGroupArgs is the arguments for resource group job.
ResourceGroupBackgroundSettings is the background settings of the resource group.
ResourceGroupInfo is the struct to store the resource group.
ResourceGroupRunawaySettings is the runaway settings of the resource group.
ResourceGroupSettings is the settings of the resource group.
SchemaDiff contains the schema modification at a particular schema version.
SequenceInfo provide meta data describing a DB sequence.
SessionInfo contain the session ID and the server ID.
SetDefaultValueArgs is the argument for setting default value ddl.
SetTiFlashReplicaArgs is the arguments for setting TiFlash replica ddl.
ShardRowIDArgs is the arguments for shard row ID ddl job.
StatsLoadItem represents the load unit for statistics's memory loading.
StatsOptions is the struct to store the stats options.
StatsWindowSettings is the settings of the stats window.
SubJob is a representation of one DDL schema change.
TableColumnArgs is the arguments for dropping column ddl or Adding column ddl.
TableIDIndexID contains TableID+IndexID of index ranges to be deleted.
TableInfo provides meta data describing a DB table.
TableItemID is composed by table ID and column/index ID.
TableLockInfo provides meta data describing a table lock.
TableLockTpInfo is composed by schema ID, table ID and table lock type.
TableNameInfo provides meta data describing a table name info.
TablePartitionArgs is the arguments for table partition related jobs, including: - ActionAlterTablePartitioning - ActionRemovePartitioning - ActionReorganizePartition - ActionAddTablePartition: don't have finished args if success.
TiFlashReplicaInfo means the flash replica info.
TimeZoneLocation represents a single time zone.
TraceInfo is the information for trace.
TruncateTableArgs is the arguments for truncate table/partition job.
TTLInfo records the TTL config.
UpdateIndexInfo is to carry the entries in the list of indexes in UPDATE INDEXES during ALTER TABLE t PARTITION BY ..
UpdateTiFlashReplicaStatusArgs is the arguments for updating TiFlash replica status ddl.
VectorIndexInfo is the information of vector index of a column.
ViewInfo provides meta data describing a DB view.
# Interfaces
FinishedJobArgs is the interface for finished job arguments.
JobArgs is the interface for job arguments.
# Type aliases
ActionType is the type for DDL action.
AdminCommandOperator indicates where the Cancel/Pause/Resume command on DDL jobs comes from.
BackfillState is the state used by the backfill-merge process.
DDLBDRType is the type for DDL when BDR enable.
DistanceMetric is the distance metric used by the vector index.
IndexOp is used to identify arguemnt type, which is only used for v1 index args.
InvolvingSchemaInfoMode is used by InvolvingSchemaInfo.Mode.
JobState is for job state.
JobVersion is the version of DDL job.
ReorgType indicates which process is used for the data reorganization.
SchemaState is the state for schema elements.
TableCacheStatusType is the type of the table cache status.
TableLockState is the state for table lock.
TempTableType is the type of the temp table.
WindowRepeatType is the type of the window repeat.