@@ -87,16 +87,18 @@ var (
8787 errIncorrectPrefixKey = terror .ClassDDL .New (codeIncorrectPrefixKey , "Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys" )
8888 errTooLongKey = terror .ClassDDL .New (codeTooLongKey ,
8989 fmt .Sprintf ("Specified key was too long; max key length is %d bytes" , maxPrefixLength ))
90- errKeyColumnDoesNotExits = terror .ClassDDL .New (codeKeyColumnDoesNotExits , "this key column doesn't exist in table" )
91- errDupKeyName = terror .ClassDDL .New (codeDupKeyName , "duplicate key name" )
92- errUnknownTypeLength = terror .ClassDDL .New (codeUnknownTypeLength , "Unknown length for type tp %d" )
93- errUnknownFractionLength = terror .ClassDDL .New (codeUnknownFractionLength , "Unknown Length for type tp %d and fraction %d" )
94- errInvalidJobVersion = terror .ClassDDL .New (codeInvalidJobVersion , "DDL job with version %d greater than current %d" )
95- errFileNotFound = terror .ClassDDL .New (codeFileNotFound , "Can't find file: './%s/%s.frm'" )
96- errErrorOnRename = terror .ClassDDL .New (codeErrorOnRename , "Error on rename of './%s/%s' to './%s/%s'" )
97- errBadField = terror .ClassDDL .New (codeBadField , "Unknown column '%s' in '%s'" )
98- errInvalidUseOfNull = terror .ClassDDL .New (codeInvalidUseOfNull , "Invalid use of NULL value" )
99- errTooManyFields = terror .ClassDDL .New (codeTooManyFields , "Too many columns" )
90+ errKeyColumnDoesNotExits = terror .ClassDDL .New (codeKeyColumnDoesNotExits , "this key column doesn't exist in table" )
91+ errDupKeyName = terror .ClassDDL .New (codeDupKeyName , "duplicate key name" )
92+ errUnknownTypeLength = terror .ClassDDL .New (codeUnknownTypeLength , "Unknown length for type tp %d" )
93+ errUnknownFractionLength = terror .ClassDDL .New (codeUnknownFractionLength , "Unknown Length for type tp %d and fraction %d" )
94+ errInvalidJobVersion = terror .ClassDDL .New (codeInvalidJobVersion , "DDL job with version %d greater than current %d" )
95+ errFileNotFound = terror .ClassDDL .New (codeFileNotFound , "Can't find file: './%s/%s.frm'" )
96+ errErrorOnRename = terror .ClassDDL .New (codeErrorOnRename , "Error on rename of './%s/%s' to './%s/%s'" )
97+ errBadField = terror .ClassDDL .New (codeBadField , "Unknown column '%s' in '%s'" )
98+ errInvalidUseOfNull = terror .ClassDDL .New (codeInvalidUseOfNull , "Invalid use of NULL value" )
99+ errTooManyFields = terror .ClassDDL .New (codeTooManyFields , "Too many columns" )
100+ errInvalidSplitRegionRanges = terror .ClassDDL .New (codeInvalidRanges , "Failed to split region ranges" )
101+ errReorgWorkerNotRunnable = terror .ClassDDL .New (codeReorgWorkerNotRunnable , "reorg worker is not runnable." )
100102
101103 // errWrongKeyColumn is for table column cannot be indexed.
102104 errWrongKeyColumn = terror .ClassDDL .New (codeWrongKeyColumn , mysql .MySQLErrName [mysql .ErrWrongKeyColumn ])
@@ -273,7 +275,7 @@ func newDDL(ctx context.Context, etcdCli *clientv3.Client, store kv.Storage,
273275 lease : lease ,
274276 ddlJobCh : make (chan struct {}, 1 ),
275277 ddlJobDoneCh : make (chan struct {}, 1 ),
276- reorgCtx : & reorgCtx {notifyCancelReorgJob : make ( chan struct {}, 1 ) },
278+ reorgCtx : & reorgCtx {notifyCancelReorgJob : 0 },
277279 ownerManager : manager ,
278280 schemaSyncer : syncer ,
279281 workerVars : variable .NewSessionVars (),
@@ -500,17 +502,19 @@ func (d *ddl) WorkerVars() *variable.SessionVars {
500502
501503// DDL error codes.
502504const (
503- codeInvalidWorker terror.ErrCode = 1
504- codeNotOwner = 2
505- codeInvalidDDLJob = 3
506- codeInvalidJobFlag = 5
507- codeRunMultiSchemaChanges = 6
508- codeWaitReorgTimeout = 7
509- codeInvalidStoreVer = 8
510- codeUnknownTypeLength = 9
511- codeUnknownFractionLength = 10
512- codeInvalidJobVersion = 11
513- codeCancelledDDLJob = 12
505+ codeInvalidWorker terror.ErrCode = 1
506+ codeNotOwner = 2
507+ codeInvalidDDLJob = 3
508+ codeInvalidJobFlag = 5
509+ codeRunMultiSchemaChanges = 6
510+ codeWaitReorgTimeout = 7
511+ codeInvalidStoreVer = 8
512+ codeUnknownTypeLength = 9
513+ codeUnknownFractionLength = 10
514+ codeInvalidJobVersion = 11
515+ codeCancelledDDLJob = 12
516+ codeInvalidRanges = 13
517+ codeReorgWorkerNotRunnable = 14
514518
515519 codeInvalidDBState = 100
516520 codeInvalidTableState = 101
0 commit comments