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

# Functions

BuildAddIndexSQL builds the SQL statement to create missing indexes.
BuildDropIndexSQL builds the SQL statement to drop index.
ConnectMySQL connects MySQL with the dsn.
EncodeIntRowID encodes an int64 row id.
EscapeIdentifier quote and escape an sql identifier.
FprintfWithIdentifiers escapes the identifiers and fprintf them.
GetAutoRandomColumn return the column with auto_random, return nil if the table doesn't have it.
GetBackoffWeightFromDB gets the backoff weight from database.
GetDropIndexInfos returns the index infos that need to be dropped and the remain indexes.
GetExplicitRequestSourceTypeFromDB gets the explicit request source type from database.
GetGlobalAutoIDAlloc returns the autoID allocators for a table.
GetJSON fetches a page and parses it as JSON.
GetMaxAutoIDBase returns the max auto ID base for a table.
GetMockTLSUrl returns tls's host for mock test.
GetStorageSize gets storage's capacity and available size.
InterpolateMySQLString interpolates a string into a MySQL string literal.
IsAccessDeniedNeedConfigPrivilegeError checks if err is generated from a query to TiDB which failed due to missing CONFIG privilege.
IsContextCanceledError returns whether the error is caused by context cancellation.
IsDirExists checks if dir exists.
IsDupKeyError checks if err is a duplicate index error.
IsEmptyDir checks if dir is empty.
IsFunctionNotExistErr checks if err is a function not exist error.
IsRaftKV2 checks whether the raft-kv2 is enabled.
IsRetryableError returns whether the error is transient (e.g.
KillMySelf sends sigint to current process, used in integration test only Only works on Unix.
NewConnPool creates a new connPool by the specified conn factory function and capacity.
NewDupDetector creates a new DupDetector.
NewGRPCConns creates a new GRPCConns.
NewPauser returns an initialized pauser.
NewTLS constructs a new HTTP client with TLS configured with the CA, certificate and key paths.
NewTLSFromMockServer constructs a new TLS instance from the certificates of an *httptest.Server.
NormalizeError converts an arbitrary error to *errors.Error based above predefined errors.
NormalizeOrWrapErr tries to normalize err.
RebaseTableAllocators rebase the allocators of a table.
Retry is shared by SQLWithRetry.perform, implementation of GlueCheckpointsDB and TiDB's glue implementation.
SameDisk is used to check dir1 and dir2 in the same disk.
SchemaExists return whether schema with specified name exists.
SprintfWithIdentifiers escapes the identifiers and sprintf them.
TableExists return whether table with specified name exists in target db.
TableHasAutoID return whether table has auto generated id.
TableHasAutoRowID return whether table has auto generated row id.
ToGRPCDialOption constructs a gRPC dial option from tls.Config.
UniqueTable returns an unique table name.
WriteMySQLIdentifier writes a MySQL identifier into the string builder.

# Constants

IndexEngineID is the engine ID for index engine.

# Variables

DefaultImportantVariables is used in ObtainImportantVariables to retrieve the system variables from downstream which may affect KV encode result.
DefaultImportVariablesTiDB is used in ObtainImportantVariables to retrieve the system variables from downstream in local/importer backend.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
ErrFoundDuplicateKeys shoud be replaced with ErrFoundDataConflictRecords and ErrFoundIndexConflictRecords (TODO).
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
error definitions.
ErrWriteTooSlow is used to get rid of the gRPC blocking issue.
MinRowID is the minimum rowID value after DupDetectKeyAdapter.Encode().

# Structs

ConnPool is a lazy pool of gRPC channels.
DataAndRanges is a pair of IngestData and list of Range.
DupDetectKeyAdapter is a key adapter that appends rowID to the key to avoid overwritten.
DupDetectOpt is the option for duplicate detection.
DupDetector extract the decoded key and value from the iter which may contain duplicate keys and store the keys encoded by KeyAdapter.
GRPCConns is a pool of gRPC connections.
KvPair contains a key-value pair and other fields that can be used to ingest KV pairs into TiKV.
MySQLConnectParam records the parameters needed to connect to a MySQL database.
NoopKeyAdapter is a key adapter that does nothing.
OnceError is an error value which will can be assigned once.
Pauser is a type which could allow multiple goroutines to wait on demand, similar to a gate or traffic light.
Range contains a start key and an end key.
SQLWithRetry constructs a retryable transaction.
StorageSize represents the storage's capacity and available size Learn from tidb-binlog source code.
TLS is a wrapper around a TLS configuration.

# Interfaces

Engine describes the common interface of local and external engine that local backend uses.
ForwardIter describes a iterator that can only move forward.
IngestData describes a common interface that is needed by TiKV write + ingest RPC.
KeyAdapter is used to encode and decode keys so that duplicate key can be identified by rowID and avoid overwritten.
KVIter is a slim interface that DupDetector needs.