Documentation ¶
Index ¶
- Variables
- func NewStorageDDLInjector(s kv.Storage) kv.Storage
- func UnwrapStorage(s kv.Storage) kv.Storage
- type Checker
- func (*Checker) AddResourceGroup(_ sessionctx.Context, _ *ast.CreateResourceGroupStmt) error
- func (*Checker) AlterPlacementPolicy(_ sessionctx.Context, _ *ast.AlterPlacementPolicyStmt) error
- func (*Checker) AlterResourceGroup(_ sessionctx.Context, _ *ast.AlterResourceGroupStmt) error
- func (d *Checker) AlterSchema(sctx sessionctx.Context, stmt *ast.AlterDatabaseStmt) error
- func (*Checker) AlterSequence(_ sessionctx.Context, _ *ast.AlterSequenceStmt) error
- func (d *Checker) AlterTable(ctx context.Context, sctx sessionctx.Context, stmt *ast.AlterTableStmt) error
- func (*Checker) BatchCreateTableWithInfo(_ sessionctx.Context, _ pmodel.CIStr, _ []*model.TableInfo, ...) error
- func (d *Checker) CleanupTableLock(ctx sessionctx.Context, tables []*ast.TableName) error
- func (d *Checker) CreateIndex(ctx sessionctx.Context, stmt *ast.CreateIndexStmt) error
- func (*Checker) CreatePlacementPolicy(_ sessionctx.Context, _ *ast.CreatePlacementPolicyStmt) error
- func (*Checker) CreatePlacementPolicyWithInfo(_ sessionctx.Context, _ *model.PolicyInfo, _ ddl.OnExist) error
- func (d *Checker) CreateSchema(ctx sessionctx.Context, stmt *ast.CreateDatabaseStmt) error
- func (d *Checker) CreateSchemaWithInfo(ctx sessionctx.Context, info *model.DBInfo, onExist ddl.OnExist) error
- func (*Checker) CreateSequence(_ sessionctx.Context, _ *ast.CreateSequenceStmt) error
- func (d *Checker) CreateTable(ctx sessionctx.Context, stmt *ast.CreateTableStmt) error
- func (*Checker) CreateTableWithInfo(_ sessionctx.Context, _ pmodel.CIStr, _ *model.TableInfo, ...) error
- func (d *Checker) CreateTestDB(ctx sessionctx.Context)
- func (d *Checker) CreateView(ctx sessionctx.Context, stmt *ast.CreateViewStmt) error
- func (d *Checker) Disable()
- func (d *Checker) DoDDLJob(ctx sessionctx.Context, job *model.Job) error
- func (d *Checker) DoDDLJobWrapper(ctx sessionctx.Context, jobW *ddl.JobWrapper) error
- func (d *Checker) DropIndex(ctx sessionctx.Context, stmt *ast.DropIndexStmt) error
- func (*Checker) DropPlacementPolicy(_ sessionctx.Context, _ *ast.DropPlacementPolicyStmt) error
- func (*Checker) DropResourceGroup(_ sessionctx.Context, _ *ast.DropResourceGroupStmt) error
- func (d *Checker) DropSchema(ctx sessionctx.Context, stmt *ast.DropDatabaseStmt) error
- func (*Checker) DropSequence(_ sessionctx.Context, _ *ast.DropSequenceStmt) (err error)
- func (d *Checker) DropTable(ctx sessionctx.Context, stmt *ast.DropTableStmt) (err error)
- func (d *Checker) DropView(ctx sessionctx.Context, stmt *ast.DropTableStmt) (err error)
- func (d *Checker) Enable()
- func (*Checker) FlashbackCluster(_ sessionctx.Context, _ uint64) (err error)
- func (d *Checker) GetID() string
- func (d *Checker) GetMinJobIDRefresher() *systable.MinJobIDRefresher
- func (d *Checker) GetScope(status string) variable.ScopeFlag
- func (d *Checker) LockTables(ctx sessionctx.Context, stmt *ast.LockTablesStmt) error
- func (d *Checker) OwnerManager() owner.Manager
- func (*Checker) RecoverSchema(_ sessionctx.Context, _ *model.RecoverSchemaInfo) (err error)
- func (*Checker) RecoverTable(_ sessionctx.Context, _ *model.RecoverTableInfo) (err error)
- func (d *Checker) RegisterStatsHandle(h *handle.Handle)
- func (d *Checker) RenameTable(ctx sessionctx.Context, stmt *ast.RenameTableStmt) error
- func (*Checker) RepairTable(_ sessionctx.Context, _ *ast.CreateTableStmt) error
- func (d *Checker) SchemaSyncer() schemaver.Syncer
- func (d *Checker) Start(startMode ddl.StartMode, ctxPool *pools.ResourcePool) error
- func (d *Checker) StateSyncer() serverstate.Syncer
- func (d *Checker) Stats(vars *variable.SessionVars) (map[string]any, error)
- func (d *Checker) Stop() error
- func (*Checker) TruncateTable(_ sessionctx.Context, _ ast.Ident) error
- func (d *Checker) UnlockTables(ctx sessionctx.Context, lockedTables []model.TableLockTpInfo) error
- func (*Checker) UpdateTableReplicaInfo(_ sessionctx.Context, _ int64, _ bool) error
- type InfoStore
- func (i *InfoStore) AllSchemaNames() []string
- func (i *InfoStore) AllTableNamesOfSchema(schema pmodel.CIStr) ([]string, error)
- func (i *InfoStore) DeleteSchema(name pmodel.CIStr) bool
- func (i *InfoStore) DeleteTable(schema, table pmodel.CIStr) error
- func (i *InfoStore) PutSchema(dbInfo *model.DBInfo)
- func (i *InfoStore) PutTable(schemaName pmodel.CIStr, tblInfo *model.TableInfo) error
- func (i *InfoStore) SchemaByName(name pmodel.CIStr) *model.DBInfo
- func (i *InfoStore) TableByName(_ context.Context, schema, table pmodel.CIStr) (*model.TableInfo, error)
- func (i *InfoStore) TableClonedByName(schema, table pmodel.CIStr) (*model.TableInfo, error)
- type InfoStoreAdaptor
- func (i InfoStoreAdaptor) SchemaByName(schema pmodel.CIStr) (*model.DBInfo, bool)
- func (i InfoStoreAdaptor) TableByName(ctx context.Context, schema, table pmodel.CIStr) (t table.Table, err error)
- func (i InfoStoreAdaptor) TableExists(schema, table pmodel.CIStr) bool
- func (i InfoStoreAdaptor) TableInfoByName(schema, table pmodel.CIStr) (*model.TableInfo, error)
- type SchemaTracker
- func (*SchemaTracker) AddResourceGroup(_ sessionctx.Context, _ *ast.CreateResourceGroupStmt) error
- func (*SchemaTracker) AlterPlacementPolicy(_ sessionctx.Context, _ *ast.AlterPlacementPolicyStmt) error
- func (*SchemaTracker) AlterResourceGroup(_ sessionctx.Context, _ *ast.AlterResourceGroupStmt) error
- func (d *SchemaTracker) AlterSchema(ctx sessionctx.Context, stmt *ast.AlterDatabaseStmt) (err error)
- func (*SchemaTracker) AlterSequence(_ sessionctx.Context, _ *ast.AlterSequenceStmt) error
- func (d *SchemaTracker) AlterTable(ctx context.Context, sctx sessionctx.Context, stmt *ast.AlterTableStmt) (err error)
- func (d *SchemaTracker) BatchCreateTableWithInfo(ctx sessionctx.Context, schema pmodel.CIStr, info []*model.TableInfo, ...) error
- func (*SchemaTracker) CleanupTableLock(_ sessionctx.Context, _ []*ast.TableName) error
- func (d *SchemaTracker) CreateIndex(ctx sessionctx.Context, stmt *ast.CreateIndexStmt) error
- func (*SchemaTracker) CreatePlacementPolicy(_ sessionctx.Context, _ *ast.CreatePlacementPolicyStmt) error
- func (*SchemaTracker) CreatePlacementPolicyWithInfo(_ sessionctx.Context, _ *model.PolicyInfo, _ ddl.OnExist) error
- func (d *SchemaTracker) CreateSchema(ctx sessionctx.Context, stmt *ast.CreateDatabaseStmt) error
- func (d *SchemaTracker) CreateSchemaWithInfo(_ sessionctx.Context, dbInfo *model.DBInfo, onExist ddl.OnExist) error
- func (*SchemaTracker) CreateSequence(_ sessionctx.Context, _ *ast.CreateSequenceStmt) error
- func (d *SchemaTracker) CreateTable(ctx sessionctx.Context, s *ast.CreateTableStmt) error
- func (d *SchemaTracker) CreateTableWithInfo(_ sessionctx.Context, dbName pmodel.CIStr, info *model.TableInfo, ...) error
- func (d *SchemaTracker) CreateTestDB(ctx sessionctx.Context)
- func (d *SchemaTracker) CreateView(ctx sessionctx.Context, s *ast.CreateViewStmt) error
- func (d *SchemaTracker) DropIndex(ctx sessionctx.Context, stmt *ast.DropIndexStmt) error
- func (*SchemaTracker) DropPlacementPolicy(_ sessionctx.Context, _ *ast.DropPlacementPolicyStmt) error
- func (*SchemaTracker) DropResourceGroup(_ sessionctx.Context, _ *ast.DropResourceGroupStmt) error
- func (d *SchemaTracker) DropSchema(_ sessionctx.Context, stmt *ast.DropDatabaseStmt) error
- func (*SchemaTracker) DropSequence(_ sessionctx.Context, _ *ast.DropSequenceStmt) (err error)
- func (d *SchemaTracker) DropTable(_ sessionctx.Context, stmt *ast.DropTableStmt) (err error)
- func (d *SchemaTracker) DropView(_ sessionctx.Context, stmt *ast.DropTableStmt) (err error)
- func (*SchemaTracker) FlashbackCluster(_ sessionctx.Context, _ uint64) (err error)
- func (*SchemaTracker) LockTables(_ sessionctx.Context, _ *ast.LockTablesStmt) error
- func (*SchemaTracker) RecoverSchema(_ sessionctx.Context, _ *model.RecoverSchemaInfo) (err error)
- func (*SchemaTracker) RecoverTable(_ sessionctx.Context, _ *model.RecoverTableInfo) (err error)
- func (d *SchemaTracker) RenameTable(ctx sessionctx.Context, stmt *ast.RenameTableStmt) error
- func (*SchemaTracker) RepairTable(_ sessionctx.Context, _ *ast.CreateTableStmt) error
- func (*SchemaTracker) TruncateTable(_ sessionctx.Context, _ ast.Ident) error
- func (*SchemaTracker) UnlockTables(_ sessionctx.Context, _ []model.TableLockTpInfo) error
- func (*SchemaTracker) UpdateTableReplicaInfo(_ sessionctx.Context, _ int64, _ bool) error
- type StorageDDLInjector
Constants ¶
This section is empty.
Variables ¶
var ( // ConstructResultOfShowCreateDatabase should be assigned to executor.ConstructResultOfShowCreateDatabase. // It is used to break cycle import. ConstructResultOfShowCreateDatabase func(sessionctx.Context, *model.DBInfo, bool, *bytes.Buffer) error // ConstructResultOfShowCreateTable should be assigned to executor.ConstructResultOfShowCreateTable. // It is used to break cycle import. ConstructResultOfShowCreateTable func(sessionctx.Context, *model.TableInfo, autoid.Allocators, *bytes.Buffer) error )
Functions ¶
func NewStorageDDLInjector ¶
NewStorageDDLInjector creates a new StorageDDLInjector to inject Checker.
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker is used to check the result of SchemaTracker is same as real DDL.
func NewChecker ¶
func NewChecker(realDDL ddl.DDL, realExecutor ddl.Executor, infoCache *infoschema.InfoCache) *Checker
NewChecker creates a Checker.
func (*Checker) AddResourceGroup ¶
func (*Checker) AddResourceGroup(_ sessionctx.Context, _ *ast.CreateResourceGroupStmt) error
AddResourceGroup implements the DDL interface. ResourceGroup do not affect the transaction.
func (*Checker) AlterPlacementPolicy ¶
func (*Checker) AlterPlacementPolicy(_ sessionctx.Context, _ *ast.AlterPlacementPolicyStmt) error
AlterPlacementPolicy implements the DDL interface.
func (*Checker) AlterResourceGroup ¶
func (*Checker) AlterResourceGroup(_ sessionctx.Context, _ *ast.AlterResourceGroupStmt) error
AlterResourceGroup implements the DDL interface.
func (*Checker) AlterSchema ¶
func (d *Checker) AlterSchema(sctx sessionctx.Context, stmt *ast.AlterDatabaseStmt) error
AlterSchema implements the DDL interface.
func (*Checker) AlterSequence ¶
func (*Checker) AlterSequence(_ sessionctx.Context, _ *ast.AlterSequenceStmt) error
AlterSequence implements the DDL interface.
func (*Checker) AlterTable ¶
func (d *Checker) AlterTable(ctx context.Context, sctx sessionctx.Context, stmt *ast.AlterTableStmt) error
AlterTable implements the DDL interface.
func (*Checker) BatchCreateTableWithInfo ¶
func (*Checker) BatchCreateTableWithInfo(_ sessionctx.Context, _ pmodel.CIStr, _ []*model.TableInfo, _ ...ddl.CreateTableOption) error
BatchCreateTableWithInfo implements the DDL interface.
func (*Checker) CleanupTableLock ¶
CleanupTableLock implements the DDL interface.
func (*Checker) CreateIndex ¶
func (d *Checker) CreateIndex(ctx sessionctx.Context, stmt *ast.CreateIndexStmt) error
CreateIndex implements the DDL interface.
func (*Checker) CreatePlacementPolicy ¶
func (*Checker) CreatePlacementPolicy(_ sessionctx.Context, _ *ast.CreatePlacementPolicyStmt) error
CreatePlacementPolicy implements the DDL interface.
func (*Checker) CreatePlacementPolicyWithInfo ¶
func (*Checker) CreatePlacementPolicyWithInfo(_ sessionctx.Context, _ *model.PolicyInfo, _ ddl.OnExist) error
CreatePlacementPolicyWithInfo implements the DDL interface.
func (*Checker) CreateSchema ¶
func (d *Checker) CreateSchema(ctx sessionctx.Context, stmt *ast.CreateDatabaseStmt) error
CreateSchema implements the DDL interface.
func (*Checker) CreateSchemaWithInfo ¶
func (d *Checker) CreateSchemaWithInfo(ctx sessionctx.Context, info *model.DBInfo, onExist ddl.OnExist) error
CreateSchemaWithInfo implements the DDL interface.
func (*Checker) CreateSequence ¶
func (*Checker) CreateSequence(_ sessionctx.Context, _ *ast.CreateSequenceStmt) error
CreateSequence implements the DDL interface.
func (*Checker) CreateTable ¶
func (d *Checker) CreateTable(ctx sessionctx.Context, stmt *ast.CreateTableStmt) error
CreateTable implements the DDL interface.
func (*Checker) CreateTableWithInfo ¶
func (*Checker) CreateTableWithInfo(_ sessionctx.Context, _ pmodel.CIStr, _ *model.TableInfo, _ []model.InvolvingSchemaInfo, _ ...ddl.CreateTableOption) error
CreateTableWithInfo implements the DDL interface.
func (*Checker) CreateTestDB ¶
func (d *Checker) CreateTestDB(ctx sessionctx.Context)
CreateTestDB creates a `test` database like the default behaviour of TiDB.
func (*Checker) CreateView ¶
func (d *Checker) CreateView(ctx sessionctx.Context, stmt *ast.CreateViewStmt) error
CreateView implements the DDL interface.
func (*Checker) DoDDLJobWrapper ¶
func (d *Checker) DoDDLJobWrapper(ctx sessionctx.Context, jobW *ddl.JobWrapper) error
DoDDLJobWrapper implements the DDL interface.
func (*Checker) DropIndex ¶
func (d *Checker) DropIndex(ctx sessionctx.Context, stmt *ast.DropIndexStmt) error
DropIndex implements the DDL interface.
func (*Checker) DropPlacementPolicy ¶
func (*Checker) DropPlacementPolicy(_ sessionctx.Context, _ *ast.DropPlacementPolicyStmt) error
DropPlacementPolicy implements the DDL interface.
func (*Checker) DropResourceGroup ¶
func (*Checker) DropResourceGroup(_ sessionctx.Context, _ *ast.DropResourceGroupStmt) error
DropResourceGroup implements the DDL interface.
func (*Checker) DropSchema ¶
func (d *Checker) DropSchema(ctx sessionctx.Context, stmt *ast.DropDatabaseStmt) error
DropSchema implements the DDL interface.
func (*Checker) DropSequence ¶
func (*Checker) DropSequence(_ sessionctx.Context, _ *ast.DropSequenceStmt) (err error)
DropSequence implements the DDL interface.
func (*Checker) DropTable ¶
func (d *Checker) DropTable(ctx sessionctx.Context, stmt *ast.DropTableStmt) (err error)
DropTable implements the DDL interface.
func (*Checker) DropView ¶
func (d *Checker) DropView(ctx sessionctx.Context, stmt *ast.DropTableStmt) (err error)
DropView implements the DDL interface.
func (*Checker) FlashbackCluster ¶
func (*Checker) FlashbackCluster(_ sessionctx.Context, _ uint64) (err error)
FlashbackCluster implements the DDL interface.
func (*Checker) GetMinJobIDRefresher ¶
func (d *Checker) GetMinJobIDRefresher() *systable.MinJobIDRefresher
GetMinJobIDRefresher implements the DDL interface.
func (*Checker) LockTables ¶
func (d *Checker) LockTables(ctx sessionctx.Context, stmt *ast.LockTablesStmt) error
LockTables implements the DDL interface.
func (*Checker) OwnerManager ¶
OwnerManager implements the DDL interface.
func (*Checker) RecoverSchema ¶
func (*Checker) RecoverSchema(_ sessionctx.Context, _ *model.RecoverSchemaInfo) (err error)
RecoverSchema implements the DDL interface.
func (*Checker) RecoverTable ¶
func (*Checker) RecoverTable(_ sessionctx.Context, _ *model.RecoverTableInfo) (err error)
RecoverTable implements the DDL interface.
func (*Checker) RegisterStatsHandle ¶
RegisterStatsHandle implements the DDL interface.
func (*Checker) RenameTable ¶
func (d *Checker) RenameTable(ctx sessionctx.Context, stmt *ast.RenameTableStmt) error
RenameTable implements the DDL interface.
func (*Checker) RepairTable ¶
func (*Checker) RepairTable(_ sessionctx.Context, _ *ast.CreateTableStmt) error
RepairTable implements the DDL interface.
func (*Checker) SchemaSyncer ¶
SchemaSyncer implements the DDL interface.
func (*Checker) StateSyncer ¶
func (d *Checker) StateSyncer() serverstate.Syncer
StateSyncer implements the DDL interface.
func (*Checker) TruncateTable ¶
TruncateTable implements the DDL interface.
func (*Checker) UnlockTables ¶
func (d *Checker) UnlockTables(ctx sessionctx.Context, lockedTables []model.TableLockTpInfo) error
UnlockTables implements the DDL interface.
func (*Checker) UpdateTableReplicaInfo ¶
UpdateTableReplicaInfo implements the DDL interface.
type InfoStore ¶
type InfoStore struct {
// contains filtered or unexported fields
}
InfoStore is a simple structure that stores DBInfo and TableInfo. It's modifiable and not thread-safe.
func NewInfoStore ¶
NewInfoStore creates a InfoStore.
func (*InfoStore) AllSchemaNames ¶
AllSchemaNames returns all the schemas' names.
func (*InfoStore) AllTableNamesOfSchema ¶
AllTableNamesOfSchema return all table names of a schema.
func (*InfoStore) DeleteSchema ¶
DeleteSchema deletes the schema from InfoSchema. Returns true when the schema exists, false otherwise.
func (*InfoStore) DeleteTable ¶
DeleteTable deletes the TableInfo, it will return ErrDatabaseNotExists or ErrTableNotExists when schema or table does not exist.
func (*InfoStore) PutTable ¶
PutTable puts a TableInfo, it will overwrite the old one. If the schema doesn't exist, it will return ErrDatabaseNotExists.
func (*InfoStore) SchemaByName ¶
SchemaByName returns the DBInfo of given name. nil if not found.
type InfoStoreAdaptor ¶
type InfoStoreAdaptor struct { infoschema.InfoSchema // contains filtered or unexported fields }
InfoStoreAdaptor convert InfoStore to InfoSchema, it only implements a part of InfoSchema interface to be used by DDL interface.
func (InfoStoreAdaptor) SchemaByName ¶
SchemaByName implements the InfoSchema interface.
func (InfoStoreAdaptor) TableByName ¶
func (i InfoStoreAdaptor) TableByName(ctx context.Context, schema, table pmodel.CIStr) (t table.Table, err error)
TableByName implements the InfoSchema interface.
func (InfoStoreAdaptor) TableExists ¶
func (i InfoStoreAdaptor) TableExists(schema, table pmodel.CIStr) bool
TableExists implements the InfoSchema interface.
func (InfoStoreAdaptor) TableInfoByName ¶
TableInfoByName implements the InfoSchema interface.
type SchemaTracker ¶
type SchemaTracker struct {
*InfoStore
}
SchemaTracker is used to track schema changes by DM. It implements ddl.Executor interface and by applying DDL, it updates the table structure to keep tracked with upstream changes.
It embeds an InfoStore which stores DBInfo and TableInfo. The DBInfo and TableInfo can be treated as immutable, so after reading them by SchemaByName or TableByName, later modifications made by SchemaTracker will not change them. SchemaTracker is not thread-safe.
func NewSchemaTracker ¶
func NewSchemaTracker(lowerCaseTableNames int) SchemaTracker
NewSchemaTracker creates a SchemaTracker. lowerCaseTableNames has the same meaning as MySQL variable lower_case_table_names.
func (*SchemaTracker) AddResourceGroup ¶
func (*SchemaTracker) AddResourceGroup(_ sessionctx.Context, _ *ast.CreateResourceGroupStmt) error
AddResourceGroup implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) AlterPlacementPolicy ¶
func (*SchemaTracker) AlterPlacementPolicy(_ sessionctx.Context, _ *ast.AlterPlacementPolicyStmt) error
AlterPlacementPolicy implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) AlterResourceGroup ¶
func (*SchemaTracker) AlterResourceGroup(_ sessionctx.Context, _ *ast.AlterResourceGroupStmt) error
AlterResourceGroup implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) AlterSchema ¶
func (d *SchemaTracker) AlterSchema(ctx sessionctx.Context, stmt *ast.AlterDatabaseStmt) (err error)
AlterSchema implements the DDL interface.
func (*SchemaTracker) AlterSequence ¶
func (*SchemaTracker) AlterSequence(_ sessionctx.Context, _ *ast.AlterSequenceStmt) error
AlterSequence implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) AlterTable ¶
func (d *SchemaTracker) AlterTable(ctx context.Context, sctx sessionctx.Context, stmt *ast.AlterTableStmt) (err error)
AlterTable implements the DDL interface.
func (*SchemaTracker) BatchCreateTableWithInfo ¶
func (d *SchemaTracker) BatchCreateTableWithInfo(ctx sessionctx.Context, schema pmodel.CIStr, info []*model.TableInfo, cs ...ddl.CreateTableOption) error
BatchCreateTableWithInfo implements the DDL interface, it will call CreateTableWithInfo for each table.
func (*SchemaTracker) CleanupTableLock ¶
func (*SchemaTracker) CleanupTableLock(_ sessionctx.Context, _ []*ast.TableName) error
CleanupTableLock implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) CreateIndex ¶
func (d *SchemaTracker) CreateIndex(ctx sessionctx.Context, stmt *ast.CreateIndexStmt) error
CreateIndex implements the DDL interface.
func (*SchemaTracker) CreatePlacementPolicy ¶
func (*SchemaTracker) CreatePlacementPolicy(_ sessionctx.Context, _ *ast.CreatePlacementPolicyStmt) error
CreatePlacementPolicy implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) CreatePlacementPolicyWithInfo ¶
func (*SchemaTracker) CreatePlacementPolicyWithInfo(_ sessionctx.Context, _ *model.PolicyInfo, _ ddl.OnExist) error
CreatePlacementPolicyWithInfo implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) CreateSchema ¶
func (d *SchemaTracker) CreateSchema(ctx sessionctx.Context, stmt *ast.CreateDatabaseStmt) error
CreateSchema implements the DDL interface.
func (*SchemaTracker) CreateSchemaWithInfo ¶
func (d *SchemaTracker) CreateSchemaWithInfo(_ sessionctx.Context, dbInfo *model.DBInfo, onExist ddl.OnExist) error
CreateSchemaWithInfo implements the DDL interface.
func (*SchemaTracker) CreateSequence ¶
func (*SchemaTracker) CreateSequence(_ sessionctx.Context, _ *ast.CreateSequenceStmt) error
CreateSequence implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) CreateTable ¶
func (d *SchemaTracker) CreateTable(ctx sessionctx.Context, s *ast.CreateTableStmt) error
CreateTable implements the DDL interface.
func (*SchemaTracker) CreateTableWithInfo ¶
func (d *SchemaTracker) CreateTableWithInfo( _ sessionctx.Context, dbName pmodel.CIStr, info *model.TableInfo, _ []model.InvolvingSchemaInfo, cs ...ddl.CreateTableOption, ) error
CreateTableWithInfo implements the DDL interface.
func (*SchemaTracker) CreateTestDB ¶
func (d *SchemaTracker) CreateTestDB(ctx sessionctx.Context)
CreateTestDB creates the `test` database, which is the default behavior of TiDB.
func (*SchemaTracker) CreateView ¶
func (d *SchemaTracker) CreateView(ctx sessionctx.Context, s *ast.CreateViewStmt) error
CreateView implements the DDL interface.
func (*SchemaTracker) DropIndex ¶
func (d *SchemaTracker) DropIndex(ctx sessionctx.Context, stmt *ast.DropIndexStmt) error
DropIndex implements the DDL interface.
func (*SchemaTracker) DropPlacementPolicy ¶
func (*SchemaTracker) DropPlacementPolicy(_ sessionctx.Context, _ *ast.DropPlacementPolicyStmt) error
DropPlacementPolicy implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) DropResourceGroup ¶
func (*SchemaTracker) DropResourceGroup(_ sessionctx.Context, _ *ast.DropResourceGroupStmt) error
DropResourceGroup implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) DropSchema ¶
func (d *SchemaTracker) DropSchema(_ sessionctx.Context, stmt *ast.DropDatabaseStmt) error
DropSchema implements the DDL interface.
func (*SchemaTracker) DropSequence ¶
func (*SchemaTracker) DropSequence(_ sessionctx.Context, _ *ast.DropSequenceStmt) (err error)
DropSequence implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) DropTable ¶
func (d *SchemaTracker) DropTable(_ sessionctx.Context, stmt *ast.DropTableStmt) (err error)
DropTable implements the DDL interface.
func (*SchemaTracker) DropView ¶
func (d *SchemaTracker) DropView(_ sessionctx.Context, stmt *ast.DropTableStmt) (err error)
DropView implements the DDL interface.
func (*SchemaTracker) FlashbackCluster ¶
func (*SchemaTracker) FlashbackCluster(_ sessionctx.Context, _ uint64) (err error)
FlashbackCluster implements the DDL interface, which is no-op in DM's case.
func (*SchemaTracker) LockTables ¶
func (*SchemaTracker) LockTables(_ sessionctx.Context, _ *ast.LockTablesStmt) error
LockTables implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) RecoverSchema ¶
func (*SchemaTracker) RecoverSchema(_ sessionctx.Context, _ *model.RecoverSchemaInfo) (err error)
RecoverSchema implements the DDL interface, which is no-op in DM's case.
func (*SchemaTracker) RecoverTable ¶
func (*SchemaTracker) RecoverTable(_ sessionctx.Context, _ *model.RecoverTableInfo) (err error)
RecoverTable implements the DDL interface, which is no-op in DM's case.
func (*SchemaTracker) RenameTable ¶
func (d *SchemaTracker) RenameTable(ctx sessionctx.Context, stmt *ast.RenameTableStmt) error
RenameTable implements the DDL interface.
func (*SchemaTracker) RepairTable ¶
func (*SchemaTracker) RepairTable(_ sessionctx.Context, _ *ast.CreateTableStmt) error
RepairTable implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) TruncateTable ¶
func (*SchemaTracker) TruncateTable(_ sessionctx.Context, _ ast.Ident) error
TruncateTable implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) UnlockTables ¶
func (*SchemaTracker) UnlockTables(_ sessionctx.Context, _ []model.TableLockTpInfo) error
UnlockTables implements the DDL interface, it's no-op in DM's case.
func (*SchemaTracker) UpdateTableReplicaInfo ¶
func (*SchemaTracker) UpdateTableReplicaInfo(_ sessionctx.Context, _ int64, _ bool) error
UpdateTableReplicaInfo implements the DDL interface, it's no-op in DM's case.
type StorageDDLInjector ¶
type StorageDDLInjector struct { Injector func(ddl.DDL, ddl.Executor, *infoschema.InfoCache) *Checker // contains filtered or unexported fields }
StorageDDLInjector wraps kv.Storage to inject checker to domain's DDL in bootstrap time.