package
9.0.0-alpha+incompatible
Repository: https://github.com/pingcap/tidb.git
Documentation: pkg.go.dev

# Packages

# Functions

AllSchemaNames returns all the schemas' names.
AppendHostInfoToRows appends host info to the rows.
ConvertCharsetCollateToLowerCaseIfNeed convert the charset / collation of table and its columns to lower case, if the table's version is prior to TableInfoVersion3.
ConvertOldVersionUTF8ToUTF8MB4IfNeed convert old version UTF8 to UTF8MB4 if config.TreatOldVersionUTF8AsUTF8MB4 is enable.
FetchClusterServerInfoWithoutPrivilegeCheck fetches cluster server information.
FilterClusterServerInfo filters serversInfo by nodeTypes and addresses.
FindTableByTblOrPartID looks for table.Table for the given id in the InfoSchema.
FormatStoreServerVersion format version of store servers(Tikv or TiFlash).
FormatTiDBVersion make TiDBVersion consistent to TiKV and PD.
GenLabelConditionValues generates the label condition values.
GetClusterServerInfo returns all components information of cluster.
GetClusterTableCopDestination gets cluster table cop request destination.
GetDataFromSessionConnectAttrs produces the rows for the session_connect_attrs table.
GetDataFromSessionVariables return the [name, value] of all session variables.
GetInstanceAddr gets the instance address.
GetMetricTableDef gets the metric table define.
GetPDServerInfo returns all PD nodes information of cluster.
GetSchedulingServerInfo returns all scheduling nodes information of cluster.
GetSequenceByName gets the sequence by name.
GetShardingInfo returns a nil or description string for the sharding information of given TableInfo.
GetStoreServerInfo returns all store nodes(TiKV or TiFlash) cluster information.
GetTableTiDBHotRegionsHistoryCols is to get TableTiDBHotRegionsHistoryCols.
GetTableTiKVRegionPeersCols is to get TableTiKVRegionPeersCols.
GetTiCDCServerInfo gets server info of TiCDC from PD.
GetTiDBServerInfo returns all TiDB nodes information of cluster.
GetTiFlashServerInfo returns all TiFlash server infos.
GetTiFlashStoreCount returns the count of tiflash server.
GetTiProxyServerInfo gets server info of TiProxy from PD.
GetTSOServerInfo returns all TSO nodes information of cluster.
HasAutoIncrementColumn checks whether the table has auto_increment columns, if so, return true and the column name.
IsClusterTableByName used to check whether the table is a cluster memory table.
IsMetricTable uses to checks whether the table is a metric table.
IsSpecialDB tells whether the database is a special database.
IsV2 tells whether an InfoSchema is v2 or not.
MockInfoSchema only serves for test.
MockInfoSchemaWithSchemaVer only serves for test.
NewBuilder creates a new Builder with a Handle.
NewCache creates a new InfoCache.
NewData creates an infoschema V2 data struct.
NewInfoSchemaV2 create infoschemaV2.
NewSessionTables creates a new NewSessionTables object.
RegisterVirtualTable register virtual tables to the builder.
SchemaByTable get a table's schema name.
SysVarHiddenForSem checks if a given sysvar is hidden according to SEM and privileges.
TableIsSequence indicates whether the schema.table is a sequence.
TableIsView indicates whether the schema.table is a view.
WithRefillOption controls the infoschema v2 cache refill operation.

# Constants

AllTiDB is uese by CLUSTER_* table, means that these tables will send cop request to all TiDB nodes.
CatalogVal is the string constant of TABLE_CATALOG.
ClusterTableDeadlocks is the string constant of cluster dead lock table.
ClusterTableMemoryUsage is the memory usage status of tidb cluster.
ClusterTableMemoryUsageOpsHistory is the memory control operators history of tidb cluster.
Cluster table indicates that these tables need to get data from other tidb nodes, which may get from all other nodes, or may get from the ddl owner.
ClusterTableSlowLog is the string constant of cluster slow query memory table.
ClusterTableStatementsSummary is the string constant of cluster statement summary table.
ClusterTableStatementsSummaryEvicted is the string constant of cluster statement summary evict table.
ClusterTableStatementsSummaryHistory is the string constant of cluster statement summary history table.
ClusterTableTiDBIndexUsage is a table to show the usage stats of indexes across the whole cluster.
ClusterTableTiDBPlanCache is the plan cache status of tidb cluster.
ClusterTableTiDBStatementsStats is the string constant of the cluster statement stats table.
ClusterTableTiDBTrx is the string constant of cluster transaction running table.
ClusterTableDeadlocks is the string constant of cluster transaction summary table.
DataLockWaitsColumnCurrentHoldingTrxID is the name of the CURRENT_HOLDING_TRX_ID column of the DATA_LOCK_WAITS table.
DataLockWaitsColumnKey is the name of the KEY column of the DATA_LOCK_WAITS table.
DataLockWaitsColumnKeyInfo is the name of the KEY_INFO column of the DATA_LOCK_WAITS table.
DataLockWaitsColumnSQLDigest is the name of the SQL_DIGEST column of the DATA_LOCK_WAITS table.
DataLockWaitsColumnSQLDigestText is the name of the SQL_DIGEST_TEXT column of the DATA_LOCK_WAITS table.
DataLockWaitsColumnTrxID is the name of the TRX_ID column of the DATA_LOCK_WAITS table.
DDLOwner is uese by tiflash_replica currently, means that this table will send cop request to DDL owner node.
ForeignKeyType is the string constant of Foreign Key.
PrimaryConstraint is the string constant of PRIMARY.
PrimaryKeyType is the string constant of PRIMARY KEY.
TableAnalyzeStatus is the string constant of Analyze Status.
TableAttributes is the string constant of attributes table.
TableCharacterSets is the string constant of infoschema charactersets memory table.
TableCheckConstraints is the list of CHECK constraints.
TableClientErrorsSummaryByHost is the string constant of client errors table.
TableClientErrorsSummaryByUser is the string constant of client errors table.
TableClientErrorsSummaryGlobal is the string constant of client errors table.
TableClusterConfig is the string constant of cluster configuration memory table.
TableClusterHardware is the string constant of cluster hardware table.
TableClusterInfo is the string constant of cluster info memory table.
TableClusterLoad is the string constant of cluster load memory table.
TableClusterLog is the string constant of cluster log memory table.
TableClusterSystemInfo is the string constant of cluster system info table.
TableCollationCharacterSetApplicability is the string constant of infoschema memory table.
TableCollations is the string constant of infoschema collations memory table.
TableColumns is the string constant of infoschema table.
TableConstraints is the string constant of TABLE_CONSTRAINTS.
TableDataLockWaits is current lock waiting status table.
TableDDLJobs is the string constant of DDL job table.
TableDeadlocks is the string constant of deadlock table.
TableEngines is the string constant of infoschema table.
TableInspectionResult is the string constant of inspection result table.
TableInspectionRules is the string constant of currently implemented inspection and summary rules.
TableInspectionSummary is the string constant of inspection summary table.
TableKeyColumn is the string constant of KEY_COLUMN_USAGE.
TableKeywords is the list of keywords.
TableMemoryUsage is the memory usage status of tidb instance.
TableMemoryUsageOpsHistory is the memory control operators history.
TableMetricSummary is a summary table that contains all metrics.
TableMetricSummaryByLabel is a metric table that contains all metrics that group by label info.
TableMetricTables is a table that contains all metrics table definition.
TablePartitions is the string constant of infoschema table.
TablePlacementPolicies is the string constant of placement policies table.
TableProcesslist is the string constant of infoschema table.
TableProfiling is the string constant of infoschema table.
TableReferConst is the string constant of REFERENTIAL_CONSTRAINTS.
TableResourceGroups is the metadata of resource groups.
TableRunawayWatches is the query list of runaway watch.
TableSchemata is the string constant of infoschema table.
TableSequences is the string constant of all sequences created by user.
TableSlowQuery is the string constant of slow query memory table.
TableStatementsSummary is the string constant of statement summary table.
TableStatementsSummaryEvicted is the string constant of statements summary evicted table.
TableStatementsSummaryHistory is the string constant of statements summary history table.
TableStatistics is the string constant of infoschema table.
TableStorageStats is a table that contains all tables disk usage.
TableTables is the string constant of infoschema table.
TableTiDBCheckConstraints is the list of CHECK constraints, with non-standard TiDB extensions.
TableTiDBHotRegions is the string constant of infoschema table.
TableTiDBHotRegionsHistory is the string constant of infoschema table.
TableTiDBIndexes is the string constant of infoschema table.
TableTiDBIndexUsage is a table to show the usage stats of indexes in the current instance.
TableTiDBPlanCache is the plan cache table.
TableTiDBServersInfo is the string constant of TiDB server information table.
TableTiDBStatementsStats is the string constant of the TiDB statement stats table.
TableTiDBTrx is current running transaction status table.
TableTiFlashIndexes is the string constant of tiflash indexes table.
TableTiFlashReplica is the string constant of tiflash replica table.
TableTiFlashSegments is the string constant of tiflash segments table.
TableTiFlashTables is the string constant of tiflash tables table.
TableTiKVRegionPeers is the string constant of infoschema table.
TableTiKVRegionStatus is the string constant of infoschema table.
TableTiKVStoreStatus is the string constant of infoschema table.
TableTrxSummary is the string constant of transaction summary table.
TableUserAttributes is the string constant of user_attributes view.
TableUserPrivileges is the string constant of infoschema user privilege table.
TableVariablesInfo is the string constant of variables_info table.
TableViews is the string constant of infoschema table.
TiFlashWrite is the TiFlash write node in disaggregated mode.
UniqueKeyType is the string constant of UNIQUE.

# Variables

ErrAccessDenied return when the user doesn't have the permission to access the table.
ErrAdminCheckTable returns when the check table in temporary mode.
ErrCannotAddForeign returns for foreign key exists.
ErrCheckConstraintDupName returns for duplicate constraint names.
ErrColumnExists returns for column already exists.
ErrColumnNotExists returns for column not exists.
ErrDatabaseDropExists returns for dropping a non-existent database.
ErrDatabaseExists returns for database already exists.
ErrDatabaseNotExists returns for database not exists.
ErrEmptyDatabase returns when the database is unexpectedly empty.
ErrForbidSchemaChange returns when the schema change is illegal.
ErrForeignKeyCannotOpenParent returns when foreign key refer table not exists.
ErrForeignKeyCannotUseVirtualColumn returns when foreign key refer virtual generated column.
ErrForeignKeyColumnNotNull returns when foreign key with SET NULL constrain and the related column has not null.
ErrForeignKeyNoColumnInParent returns when foreign key refer columns don't exist in parent table.
ErrForeignKeyNoIndexInParent returns when foreign key refer columns don't have related index in parent table.
ErrForeignKeyNotExists returns for foreign key not exists.
ErrForeignKeyNotMatch returns for foreign key not match.
ErrForeignKeyOnPartitioned returns for foreign key on partition table.
ErrIndexExists returns for index already exists.
ErrKeyNameDuplicate returns for index duplicate when rename index.
ErrKeyNotExists returns for index not exists.
ErrMultiplePriKey returns for multiple primary keys.
ErrNonuniqTable returns when none unique tables errors.
ErrPlacementPolicyExists returns for placement_policy policy already exists.
ErrPlacementPolicyNotExists return for placement_policy policy not exists.
ErrReservedSyntax for internal syntax.
ErrResourceGroupExists return for resource group already exists.
ErrResourceGroupInvalidBackgroundTaskName return for unknown resource group background task name.
ErrResourceGroupInvalidForRole return for invalid resource group for role.
ErrResourceGroupNotExists return for resource group not exists.
ErrResourceGroupSupportDisabled returns for resource group feature is disabled.
ErrSequenceDropExists returns for dropping a non-exist sequence.
ErrTableDropExists returns for dropping a non-existent table.
ErrTableExists returns for table already exists.
ErrTableLocked returns when the table was locked by other session.
ErrTableNotExists returns for table not exists.
ErrTableNotLocked returns when session has explicitly lock tables, then visit unlocked table will return this error.
ErrTableNotLockedForWrite returns for write tables when only hold the table read lock.
ErrTableWithoutPrimaryKey returns when there is no primary key on a table and sql_require_primary_key is set.
ErrTooManyKeyParts returns for too many key parts.
ErrUserAlreadyExists return for creating a existent user.
ErrUserDropExists returns for dropping a non-existent user.
ErrWrongObject returns when the table/view/sequence is not the expected object.
MetricTableMap records the metric table definition, export for test.
TableTiDBHotRegionsCols is TiDB hot region mem table columns.
TableTiDBHotRegionsHistoryCols is TiDB hot region history mem table columns.
TableTiKVRegionPeersCols is TiKV region peers mem table columns.
TableTiKVRegionStatusCols is TiKV region status mem table columns.
TableTiKVStoreStatusCols is TiDB kv store status columns.

# Structs

Builder builds a new InfoSchema.
Data is the core data struct of infoschema V2.
InfoCache handles information schema, including getting and setting.
MetricTableDef is the metric table define.
SchemaAndTableName contains the lower-case schema name and table name.
ServerInfo represents the basic server information of single cluster component.
SessionExtendedInfoSchema implements InfoSchema Local temporary table has a loose relationship with database.
SessionTables store local temporary tables.
Sieve is an efficient turn-Key eviction algorithm for web caches.
TableItem is exported from tableItem.
VirtualTable is a dummy table.Table implementation.

# Interfaces

InfoSchema is the interface used to retrieve the schema information.

# Type aliases

ClusterTableCopDestination means the destination that cluster tables will send cop requests to.