Versions in this module Expand all Collapse all v7 v7.0.4 Jan 30, 2023 v7.0.2 Jan 30, 2023 v7.0.1 Jan 30, 2023 v7.0.0 Jan 30, 2023 Changes in this version + const AssertionLevel + const BinlogInfo + const CollectRuntimeStats + const CommitHook + const CommitTSUpperBoundCheck + const Enable1PC + const EnableAsyncCommit + const GlobalReplicaScope + const GlobalTxnScope + const GuaranteeLinearizability + const InfoSchema + const InternalTxnAdmin + const InternalTxnBR + const InternalTxnBackfillDDLPrefix + const InternalTxnBindInfo + const InternalTxnBootstrap + const InternalTxnCacheTable + const InternalTxnDDL + const InternalTxnGC + const InternalTxnMeta + const InternalTxnOthers + const InternalTxnPrivilege + const InternalTxnStats + const InternalTxnSysVar + const InternalTxnTTL + const InternalTxnTelemetry + const InternalTxnTools + const InternalTxnTrace + const IsStalenessReadOnly + const IsolationLevel + const KVFilter + const KeyOnly + const LocalTxnScope + const MatchStoreLabels + const NotFillCache + const Pessimistic + const Priority + const PriorityHigh + const PriorityLow + const PriorityNormal + const RPCInterceptor + const ReadReplicaScope + const ReplicaRead + const ReplicaReadAdjuster + const ReqSubTypeAnalyzeCol + const ReqSubTypeAnalyzeIdx + const ReqSubTypeBasic + const ReqSubTypeDesc + const ReqSubTypeGroupBy + const ReqSubTypeSignature + const ReqSubTypeTopN + const ReqTypeAnalyze + const ReqTypeChecksum + const ReqTypeDAG + const ReqTypeIndex + const ReqTypeSelect + const RequestSourceInternal + const RequestSourceType + const ResourceGroupName + const ResourceGroupTag + const ResourceGroupTagger + const SampleStep + const ScanBatchSize + const SchemaAmender + const SchemaChecker + const SnapInterceptor + const SnapshotTS + const SyncLog + const TableToColumnMaps + const TaskID + const TimeToPrintLongTimeInternalTxn + const TxnRetryableMark + const TxnScope + const TxnSource + const UnCommitIndexKVFlag + var ErrAssertionFailed = dbterror.ClassTiKV.NewStd(mysql.ErrAssertionFailed) + var ErrCannotSetNilValue = dbterror.ClassKV.NewStd(mysql.ErrCannotSetNilValue) + var ErrEntryTooLarge = dbterror.ClassKV.NewStd(mysql.ErrEntryTooLarge) + var ErrInvalidTxn = dbterror.ClassKV.NewStd(mysql.ErrInvalidTxn) + var ErrKeyExists = dbterror.ClassKV.NewStd(mysql.ErrDupEntry) + var ErrLockExpire = dbterror.ClassTiKV.NewStd(mysql.ErrLockExpire) + var ErrNotExist = dbterror.ClassKV.NewStd(mysql.ErrNotExist) + var ErrNotImplemented = dbterror.ClassKV.NewStd(mysql.ErrNotImplemented) + var ErrTxnRetryable = dbterror.ClassKV.NewStdErr(mysql.ErrTxnRetryable, ...) + var ErrTxnTooLarge = dbterror.ClassKV.NewStd(mysql.ErrTxnTooLarge) + var ErrWriteConflict = dbterror.ClassKV.NewStdErr(mysql.ErrWriteConflict, ...) + var ErrWriteConflictInTiDB = dbterror.ClassKV.NewStdErr(mysql.ErrWriteConflictInTiDB, ...) + var MaxVersion = Version + var MinVersion = Version + var RequestSourceKey = util.RequestSourceKey + var TxnEntrySizeLimit uint64 = config.DefTxnEntrySizeLimit + var TxnTotalSizeLimit uint64 = config.DefTxnTotalSizeLimit + var WithInternalSourceType = util.WithInternalSourceType + func BackOff(attempts uint) int + func GetDuplicateErrorHandleString(handle Handle) string + func GetInt64(ctx context.Context, r Retriever, k Key) (int64, error) + func GetInternalSourceType(ctx context.Context) string + func GetMinInnerTxnStartTS(now time.Time, startTSLowerLimit uint64, curMinStartTS uint64) uint64 + func IncInt64(rm RetrieverMutator, k Key, step int64) (int64, error) + func IsErrNotFound(err error) bool + func IsTxnRetryableError(err error) bool + func NextUntil(it Iterator, fn FnKeyCmp) error + func PrintLongTimeInternalTxn(now time.Time, startTS uint64, runByFunction bool) + func RunInNewTxn(ctx context.Context, store Storage, retryable bool, ...) error + func WalkMemBuffer(memBuf Retriever, f func(k Key, v []byte) error) error + type AggressiveLockingController interface + CancelAggressiveLocking func(ctx context.Context) error + DoneAggressiveLocking func(ctx context.Context) error + IsInAggressiveLockingMode func() bool + RetryAggressiveLocking func(ctx context.Context) error + StartAggressiveLocking func() error + type AssertionProto interface + SetAssertion func(key []byte, assertion ...FlagsOp) error + type BatchGetter interface + BatchGet func(ctx context.Context, keys []Key) (map[string][]byte, error) + type Client interface + IsRequestTypeSupported func(reqType, subType int64) bool + Send func(ctx context.Context, req *Request, vars interface{}, option *ClientSendOption) Response + type ClientSendOption struct + EnableCollectExecutionInfo bool + EnabledRateLimitAction bool + EventCb trxevents.EventCallback + SessionMemTracker *memory.Tracker + type CommonHandle struct + func NewCommonHandle(encoded []byte) (*CommonHandle, error) + func (*CommonHandle) IntValue() int64 + func (*CommonHandle) IsInt() bool + func (ch *CommonHandle) Compare(h Handle) int + func (ch *CommonHandle) Data() ([]types.Datum, error) + func (ch *CommonHandle) Encoded() []byte + func (ch *CommonHandle) EncodedCol(idx int) []byte + func (ch *CommonHandle) Equal(h Handle) bool + func (ch *CommonHandle) ExtraMemSize() uint64 + func (ch *CommonHandle) Len() int + func (ch *CommonHandle) MemUsage() uint64 + func (ch *CommonHandle) Next() Handle + func (ch *CommonHandle) NumCols() int + func (ch *CommonHandle) String() string + type CoprRequestAdjuster func(*Request, int) bool + type Driver interface + Open func(path string) (Storage, error) + type EmptyIterator struct + func (*EmptyIterator) Close() + func (*EmptyIterator) Key() Key + func (*EmptyIterator) Next() error + func (*EmptyIterator) Valid() bool + func (*EmptyIterator) Value() []byte + type EmptyRetriever struct + func (*EmptyRetriever) Get(_ context.Context, _ Key) ([]byte, error) + func (*EmptyRetriever) Iter(_ Key, _ Key) (Iterator, error) + func (*EmptyRetriever) IterReverse(_ Key) (Iterator, error) + type Entry struct + Key Key + Value []byte + type EtcdBackend interface + EtcdAddrs func() ([]string, error) + StartGCWorker func() error + TLSConfig func() *tls.Config + type FlagsOp uint16 + const SetAssertExist + const SetAssertNone + const SetAssertNotExist + const SetAssertUnknown + const SetNeedConstraintCheckInPrewrite + const SetNeedLocked + const SetPresumeKeyNotExists + const SetPreviousPresumeKeyNotExists + type FnKeyCmp func(key Key) bool + type Getter interface + Get func(ctx context.Context, k Key) ([]byte, error) + type Handle interface + Compare func(h Handle) int + Data func() ([]types.Datum, error) + Encoded func() []byte + EncodedCol func(idx int) []byte + Equal func(h Handle) bool + ExtraMemSize func() uint64 + IntValue func() int64 + IsInt func() bool + Len func() int + MemUsage func() uint64 + Next func() Handle + NumCols func() int + String func() string + type HandleMap struct + func NewHandleMap() *HandleMap + func (m *HandleMap) Delete(h Handle) + func (m *HandleMap) Get(h Handle) (v interface{}, ok bool) + func (m *HandleMap) Len() int + func (m *HandleMap) Range(fn func(h Handle, val interface{}) bool) + func (m *HandleMap) Set(h Handle, val interface{}) + type InjectedSnapshot struct + func (t *InjectedSnapshot) BatchGet(ctx context.Context, keys []Key) (map[string][]byte, error) + func (t *InjectedSnapshot) Get(ctx context.Context, k Key) ([]byte, error) + type InjectedStore struct + func (s *InjectedStore) Begin(opts ...tikv.TxnOption) (Transaction, error) + func (s *InjectedStore) GetSnapshot(ver Version) Snapshot + type InjectedTransaction struct + func (t *InjectedTransaction) BatchGet(ctx context.Context, keys []Key) (map[string][]byte, error) + func (t *InjectedTransaction) Commit(ctx context.Context) error + func (t *InjectedTransaction) Get(ctx context.Context, k Key) ([]byte, error) + type InjectionConfig struct + func (c *InjectionConfig) SetCommitError(err error) + func (c *InjectionConfig) SetGetError(err error) + type IntHandle int64 + func (IntHandle) EncodedCol(_ int) []byte + func (IntHandle) ExtraMemSize() uint64 + func (IntHandle) IsInt() bool + func (IntHandle) Len() int + func (IntHandle) MemUsage() uint64 + func (IntHandle) NumCols() int + func (ih IntHandle) Compare(h Handle) int + func (ih IntHandle) Data() ([]types.Datum, error) + func (ih IntHandle) Encoded() []byte + func (ih IntHandle) Equal(h Handle) bool + func (ih IntHandle) IntValue() int64 + func (ih IntHandle) Next() Handle + func (ih IntHandle) String() string + type IsoLevel int + const RC + const RCCheckTS + const SI + type Iterator interface + Close func() + Key func() Key + Next func() error + Valid func() bool + Value func() []byte + type Key []byte + func FindKeysInStage(m MemBuffer, h StagingHandle, predicate func(Key, KeyFlags, []byte) bool) []Key + func (k Key) Clone() Key + func (k Key) Cmp(another Key) int + func (k Key) HasPrefix(prefix Key) bool + func (k Key) Next() Key + func (k Key) PrefixNext() Key + func (k Key) String() string + type KeyFlags uint8 + func ApplyFlagsOps(origin KeyFlags, ops ...FlagsOp) KeyFlags + func (f KeyFlags) HasAssertExists() bool + func (f KeyFlags) HasAssertNotExists() bool + func (f KeyFlags) HasAssertUnknown() bool + func (f KeyFlags) HasAssertionFlags() bool + func (f KeyFlags) HasNeedConstraintCheckInPrewrite() bool + func (f KeyFlags) HasNeedLocked() bool + func (f KeyFlags) HasPresumeKeyNotExists() bool + type KeyRange struct + EndKey Key + StartKey Key + XXXNoUnkeyedLiteral struct{} + XXXsizecache int32 + XXXunrecognized []byte + func (r *KeyRange) IsPoint() bool + type KeyRanges struct + func NewNonParitionedKeyRanges(ranges []KeyRange) *KeyRanges + func NewNonParitionedKeyRangesWithHint(ranges []KeyRange, hints []int) *KeyRanges + func NewPartitionedKeyRanges(ranges [][]KeyRange) *KeyRanges + func NewPartitionedKeyRangesWithHints(ranges [][]KeyRange, hints [][]int) *KeyRanges + func (rr *KeyRanges) AppendSelfTo(ranges []KeyRange) []KeyRange + func (rr *KeyRanges) FirstPartitionRange() []KeyRange + func (rr *KeyRanges) ForEachPartition(theFunc func([]KeyRange)) + func (rr *KeyRanges) ForEachPartitionWithErr(theFunc func([]KeyRange, []int) error) (err error) + func (rr *KeyRanges) IsFullySorted() bool + func (rr *KeyRanges) PartitionNum() int + func (rr *KeyRanges) SetToNonPartitioned() error + func (rr *KeyRanges) SortByFunc(sortFunc func(i, j KeyRange) bool) + func (rr *KeyRanges) TotalRangeNum() int + type LockCtx = tikvstore.LockCtx + type MPPBuildTasksRequest struct + KeyRanges []KeyRange + PartitionIDAndRanges []PartitionIDAndRanges + StartTS uint64 + type MPPClient interface + ConstructMPPTasks func(context.Context, *MPPBuildTasksRequest, time.Duration) ([]MPPTaskMeta, error) + DispatchMPPTasks func(ctx context.Context, vars interface{}, reqs []*MPPDispatchRequest, ...) Response + type MPPDispatchRequest struct + Data []byte + ID int64 + IsRoot bool + Meta MPPTaskMeta + MppQueryID MPPQueryID + SchemaVar int64 + StartTs uint64 + State MppTaskStates + Timeout uint64 + type MPPQueryID struct + LocalQueryID uint64 + QueryTs uint64 + ServerID uint64 + type MPPTask struct + ID int64 + IsDisaggregatedTiFlashStaticPrune bool + Meta MPPTaskMeta + MppQueryID MPPQueryID + PartitionTableIDs []int64 + StartTs uint64 + TableID int64 + func (t *MPPTask) ToPB() *mpp.TaskMeta + type MPPTaskMeta interface + GetAddress func() string + type MemAwareHandleMap struct + func NewMemAwareHandleMap() *MemAwareHandleMap[V] + func (m *MemAwareHandleMap[V]) Get(h Handle) (v V, ok bool) + func (m *MemAwareHandleMap[V]) Range(fn func(h Handle, val interface{}) bool) + func (m *MemAwareHandleMap[V]) Set(h Handle, val V) int64 + type MemBuffer interface + Cleanup func(StagingHandle) + DeleteWithFlags func(Key, ...FlagsOp) error + GetFlags func(Key) (KeyFlags, error) + InspectStage func(StagingHandle, func(Key, KeyFlags, []byte)) + Len func() int + RLock func() + RUnlock func() + Release func(StagingHandle) + RemoveFromBuffer func(Key) + SetWithFlags func(Key, []byte, ...FlagsOp) error + Size func() int + SnapshotGetter func() Getter + SnapshotIter func(k, upperbound Key) Iterator + Staging func() StagingHandle + UpdateFlags func(Key, ...FlagsOp) + type MemManager interface + Delete func(tableID int64) + UnionGet func(ctx context.Context, tid int64, snapshot Snapshot, key Key) ([]byte, error) + func NewCacheDB() MemManager + type MppTaskStates uint8 + const MppTaskCancelled + const MppTaskDone + const MppTaskReady + const MppTaskRunning + type Mutator interface + Delete func(k Key) error + Set func(k Key, v []byte) error + type PartitionHandle struct + PartitionID int64 + func NewPartitionHandle(pid int64, h Handle) PartitionHandle + func (ph PartitionHandle) Compare(h Handle) int + func (ph PartitionHandle) Equal(h Handle) bool + func (ph PartitionHandle) ExtraMemSize() uint64 + func (ph PartitionHandle) MemUsage() uint64 + type PartitionIDAndRanges struct + ID int64 + KeyRanges []KeyRange + type ReplicaReadType byte + const ReplicaReadClosest + const ReplicaReadClosestAdaptive + const ReplicaReadFollower + const ReplicaReadLeader + const ReplicaReadLearner + const ReplicaReadMixed + func (r ReplicaReadType) IsClosestRead() bool + func (r ReplicaReadType) IsFollowerRead() bool + type Request struct + BatchCop bool + Cacheable bool + ClosestReplicaReadAdjuster CoprRequestAdjuster + Concurrency int + Data []byte + Desc bool + IsStaleness bool + IsolationLevel IsoLevel + KeepOrder bool + KeyRanges *KeyRanges + MatchStoreLabels []*metapb.StoreLabel + MemTracker *memory.Tracker + NotFillCache bool + Paging struct{ ... } + PartitionIDAndRanges []PartitionIDAndRanges + Priority int + ReadReplicaScope string + ReplicaRead ReplicaReadType + RequestSource util.RequestSource + ResourceGroupName string + ResourceGroupTagger tikvrpc.ResourceGroupTagger + SchemaVar int64 + StartTs uint64 + StoreBatchSize int + StoreType StoreType + TaskID uint64 + TiDBServerID uint64 + Tp int64 + TxnScope string + type RequestSource = util.RequestSource + type RequestTypeSupportedChecker struct + func (d RequestTypeSupportedChecker) IsRequestTypeSupported(reqType, subType int64) bool + type Response interface + Close func() error + Next func(ctx context.Context) (resultSubset ResultSubset, err error) + type ResultSubset interface + GetData func() []byte + GetStartKey func() Key + MemSize func() int64 + RespTime func() time.Duration + type Retriever interface + Iter func(k Key, upperBound Key) (Iterator, error) + IterReverse func(k Key) (Iterator, error) + type RetrieverMutator interface + type Snapshot interface + BatchGet func(ctx context.Context, keys []Key) (map[string][]byte, error) + SetOption func(opt int, val interface{}) + type SnapshotInterceptor interface + OnBatchGet func(ctx context.Context, snap Snapshot, keys []Key) (map[string][]byte, error) + OnGet func(ctx context.Context, snap Snapshot, k Key) ([]byte, error) + OnIter func(snap Snapshot, k Key, upperBound Key) (Iterator, error) + OnIterReverse func(snap Snapshot, k Key) (Iterator, error) + type SplittableStore interface + CheckRegionInScattering func(regionID uint64) (bool, error) + SplitRegions func(ctx context.Context, splitKey [][]byte, scatter bool, tableID *int64) (regionID []uint64, err error) + WaitScatterRegionFinish func(ctx context.Context, regionID uint64, backOff int) error + type StagingHandle int + var InvalidStagingHandle StagingHandle = 0 + var LastActiveStagingHandle StagingHandle = -1 + type Storage interface + Begin func(opts ...tikv.TxnOption) (Transaction, error) + Close func() error + CurrentVersion func(txnScope string) (Version, error) + Describe func() string + GetClient func() Client + GetCodec func() tikv.Codec + GetLockWaits func() ([]*deadlockpb.WaitForEntry, error) + GetMPPClient func() MPPClient + GetMemCache func() MemManager + GetMinSafeTS func(txnScope string) uint64 + GetOracle func() oracle.Oracle + GetSnapshot func(ver Version) Snapshot + Name func() string + ShowStatus func(ctx context.Context, key string) (interface{}, error) + SupportDeleteRange func() (supported bool) + UUID func() string + func NewInjectedStore(store Storage, cfg *InjectionConfig) Storage + type StorageWithPD interface + GetPDClient func() pd.Client + type StoreType uint8 + const TiDB + const TiFlash + const TiKV + const UnSpecified + func (t StoreType) Name() string + type Transaction interface + BatchGet func(ctx context.Context, keys []Key) (map[string][]byte, error) + CacheTableInfo func(id int64, info *model.TableInfo) + ClearDiskFullOpt func() + Commit func(context.Context) error + GetMemBuffer func() MemBuffer + GetMemDBCheckpoint func() *tikv.MemDBCheckpoint + GetOption func(opt int) interface{} + GetSnapshot func() Snapshot + GetTableInfo func(id int64) *model.TableInfo + GetVars func() interface{} + IsPessimistic func() bool + IsReadOnly func() bool + Len func() int + LockKeys func(ctx context.Context, lockCtx *LockCtx, keys ...Key) error + LockKeysFunc func(ctx context.Context, lockCtx *LockCtx, fn func(), keys ...Key) error + Mem func() uint64 + Reset func() + Rollback func() error + RollbackMemDBToCheckpoint func(*tikv.MemDBCheckpoint) + SetDiskFullOpt func(level kvrpcpb.DiskFullOpt) + SetMemoryFootprintChangeHook func(func(uint64)) + SetOption func(opt int, val interface{}) + SetVars func(vars interface{}) + Size func() int + StartTS func() uint64 + String func() string + UpdateMemBufferFlags func(key []byte, flags ...FlagsOp) + Valid func() bool + type TxnScopeVar struct + func NewDefaultTxnScopeVar() TxnScopeVar + func NewGlobalTxnScopeVar() TxnScopeVar + func NewLocalTxnScopeVar(txnScope string) TxnScopeVar + func (t TxnScopeVar) GetTxnScope() string + func (t TxnScopeVar) GetVarValue() string + type Variables = tikv.Variables + func NewVariables(killed *uint32) *Variables + type Version struct + Ver uint64 + func NewVersion(v uint64) Version + func (v Version) Cmp(another Version) int + type VersionProvider interface + CurrentVersion func() (Version, error) Other modules containing this package github.com/lemon-mint/tidb