tidb: github.com/pingcap/tidb/util/admin Index | Files

package admin

import "github.com/pingcap/tidb/util/admin"

Index

Package Files

admin.go

Constants

const (
    // TblCntGreater means that the number of table rows is more than the number of index rows.
    TblCntGreater byte = 1
    // IdxCntGreater means that the number of index rows is more than the number of table rows.
    IdxCntGreater byte = 2
)

Count greater Types

const DefNumHistoryJobs = 10

DefNumHistoryJobs is default value of the default number of history job

const MaxHistoryJobs = 10

MaxHistoryJobs is exported for testing.

Variables

var (
    // ErrDataInConsistent indicate that meets inconsistent data.
    ErrDataInConsistent = terror.ClassAdmin.New(mysql.ErrDataInConsistent, mysql.MySQLErrName[mysql.ErrDataInConsistent])
    // ErrDDLJobNotFound indicates the job id was not found.
    ErrDDLJobNotFound = terror.ClassAdmin.New(mysql.ErrDDLJobNotFound, mysql.MySQLErrName[mysql.ErrDDLJobNotFound])
    // ErrCancelFinishedDDLJob returns when cancel a finished ddl job.
    ErrCancelFinishedDDLJob = terror.ClassAdmin.New(mysql.ErrCancelFinishedDDLJob, mysql.MySQLErrName[mysql.ErrCancelFinishedDDLJob])
    // ErrCannotCancelDDLJob returns when cancel a almost finished ddl job, because cancel in now may cause data inconsistency.
    ErrCannotCancelDDLJob = terror.ClassAdmin.New(mysql.ErrCannotCancelDDLJob, mysql.MySQLErrName[mysql.ErrCannotCancelDDLJob])
)

func CancelJobs Uses

func CancelJobs(txn kv.Transaction, ids []int64) ([]error, error)

CancelJobs cancels the DDL jobs.

func CheckIndicesCount Uses

func CheckIndicesCount(ctx sessionctx.Context, dbName, tableName string, indices []string) (byte, int, error)

CheckIndicesCount compares indices count with table count. It returns the count greater type, the index offset and an error. It returns nil if the count from the index is equal to the count from the table columns, otherwise it returns an error and the corresponding index's offset.

func CheckRecordAndIndex Uses

func CheckRecordAndIndex(sessCtx sessionctx.Context, txn kv.Transaction, t table.Table, idx table.Index, genExprs map[model.TableColumnID]expression.Expression) error

CheckRecordAndIndex is exported for testing.

func GetDDLJobs Uses

func GetDDLJobs(txn kv.Transaction) ([]*model.Job, error)

GetDDLJobs get all DDL jobs and sorts jobs by job.ID.

func GetHistoryDDLJobs Uses

func GetHistoryDDLJobs(txn kv.Transaction, maxNumJobs int) ([]*model.Job, error)

GetHistoryDDLJobs returns the DDL history jobs and an error. The maximum count of history jobs is num.

func IsJobRollbackable Uses

func IsJobRollbackable(job *model.Job) bool

IsJobRollbackable checks whether the job can be rollback.

type DDLInfo Uses

type DDLInfo struct {
    SchemaVer   int64
    ReorgHandle int64        // It's only used for DDL information.
    Jobs        []*model.Job // It's the currently running jobs.
}

DDLInfo is for DDL information.

func GetDDLInfo Uses

func GetDDLInfo(txn kv.Transaction) (*DDLInfo, error)

GetDDLInfo returns DDL information.

type RecordData Uses

type RecordData struct {
    Handle int64
    Values []types.Datum
}

RecordData is the record data composed of a handle and values.

Package admin imports 21 packages (graph) and is imported by 39 packages. Updated 2020-02-17. Refresh now. Tools for package owners.