Versions in this module Expand all Collapse all v1 v1.0.0 Oct 16, 2017 Changes in this version + const DDLAllSchemaVersions + const DDLGlobalSchemaVersion + const DDLOwnerKey + const InitialVersion + var CheckVersFirstWaitTime = 50 * time.Millisecond + var EnableSplitTableRegion = false + var ErrCantDropFieldOrKey = terror.ClassDDL.New(codeCantDropFieldOrKey, "can't drop field; check that column/key exists") + var ErrCantRemoveAllFields = terror.ClassDDL.New(codeCantRemoveAllFields, "can't delete all columns with ALTER TABLE") + var ErrColumnBadNull = terror.ClassDDL.New(codeBadNull, "column cann't be null") + var ErrInvalidColumnState = terror.ClassDDL.New(codeInvalidColumnState, "invalid column state") + var ErrInvalidDBState = terror.ClassDDL.New(codeInvalidDBState, "invalid database state") + var ErrInvalidForeignKeyState = terror.ClassDDL.New(codeInvalidForeignKeyState, "invalid foreign key state") + var ErrInvalidIndexState = terror.ClassDDL.New(codeInvalidIndexState, "invalid index state") + var ErrInvalidOnUpdate = terror.ClassDDL.New(codeInvalidOnUpdate, "invalid ON UPDATE clause for the column") + var ErrInvalidTableState = terror.ClassDDL.New(codeInvalidTableState, "invalid table state") + var ErrTooLongIdent = terror.ClassDDL.New(codeTooLongIdent, "Identifier name too long") + var ErrUnsupportedModifyPrimaryKey = terror.ClassDDL.New(codeUnsupportedModifyPrimaryKey, "unsupported %s primary key") + var ErrWrongColumnName = terror.ClassDDL.New(codeWrongColumnName, mysql.MySQLErrName[mysql.ErrWrongColumnName]) + var ErrWrongDBName = terror.ClassDDL.New(codeWrongDBName, mysql.MySQLErrName[mysql.ErrWrongDBName]) + var ErrWrongNameForIndex = terror.ClassDDL.New(codeWrongNameForIndex, mysql.MySQLErrName[mysql.ErrWrongNameForIndex]) + var ErrWrongTableName = terror.ClassDDL.New(codeWrongTableName, mysql.MySQLErrName[mysql.ErrWrongTableName]) + var RunWorker = true + var SyncerSessionTTL = 10 * 60 + var TableColumnCountLimit = 512 + type BaseCallback struct + func (c *BaseCallback) OnChanged(err error) error + func (c *BaseCallback) OnJobRunBefore(job *model.Job) + func (c *BaseCallback) OnJobUpdated(job *model.Job) + func (c *BaseCallback) OnWatched(ctx goctx.Context) + type Callback interface + OnChanged func(err error) error + OnJobRunBefore func(job *model.Job) + OnJobUpdated func(job *model.Job) + OnWatched func(ctx goctx.Context) + type DDL interface + AlterTable func(ctx context.Context, tableIdent ast.Ident, spec []*ast.AlterTableSpec) error + CreateIndex func(ctx context.Context, tableIdent ast.Ident, unique bool, indexName model.CIStr, ...) error + CreateSchema func(ctx context.Context, name model.CIStr, charsetInfo *ast.CharsetOpt) error + CreateTable func(ctx context.Context, ident ast.Ident, cols []*ast.ColumnDef, ...) error + CreateTableWithLike func(ctx context.Context, ident, referIdent ast.Ident) error + DropIndex func(ctx context.Context, tableIdent ast.Ident, indexName model.CIStr) error + DropSchema func(ctx context.Context, schema model.CIStr) error + DropTable func(ctx context.Context, tableIdent ast.Ident) (err error) + GetInformationSchema func() infoschema.InfoSchema + GetLease func() time.Duration + GetScope func(status string) variable.ScopeFlag + OwnerManager func() owner.Manager + RegisterEventCh func(chan<- *Event) + RenameTable func(ctx context.Context, oldTableIdent, newTableIdent ast.Ident) error + SchemaSyncer func() SchemaSyncer + SetHook func(h Callback) + SetLease func(ctx goctx.Context, lease time.Duration) + Stats func(vars *variable.SessionVars) (map[string]interface{}, error) + Stop func() error + TruncateTable func(ctx context.Context, tableIdent ast.Ident) error + WorkerVars func() *variable.SessionVars + func NewDDL(ctx goctx.Context, etcdCli *clientv3.Client, store kv.Storage, ...) DDL + type Event struct + ColumnInfo *model.ColumnInfo + IndexInfo *model.IndexInfo + TableInfo *model.TableInfo + Tp model.ActionType + func (e *Event) String() string + type SchemaSyncer interface + Done func() <-chan struct{} + GlobalVersionCh func() clientv3.WatchChan + Init func(ctx goctx.Context) error + MustGetGlobalVersion func(ctx goctx.Context) (int64, error) + OwnerCheckAllVersions func(ctx goctx.Context, latestVer int64) error + OwnerUpdateGlobalVersion func(ctx goctx.Context, version int64) error + RemoveSelfVersionPath func() error + Restart func(ctx goctx.Context) error + UpdateSelfVersion func(ctx goctx.Context, version int64) error + func NewMockSchemaSyncer() SchemaSyncer + func NewSchemaSyncer(etcdCli *clientv3.Client, id string) SchemaSyncer