Skip to content

Commit

Permalink
mysql: add ddl-related error code and name (#630)
Browse files Browse the repository at this point in the history
  • Loading branch information
bb7133 committed Nov 12, 2019
1 parent e3789d9 commit 3b43b46
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mysql/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,23 @@ const (
ErrUnsupportedValueForVar = 8047
ErrUnsupportedIsolationLevel = 8048

// Error codes used by TiDB ddl package
ErrUnsupportedDDLOperation = 8200
ErrNotOwner = 8201
ErrCantDecodeIndex = 8202
ErrInvalidDDLWorker = 8203
ErrInvalidDDLJob = 8204
ErrInvalidDDLJobFlag = 8205
ErrWaitReorgTimeout = 8206
ErrInvalidStoreVersion = 8207
ErrUnknownTypeLength = 8208
ErrUnknownFractionLength = 8209
ErrInvalidDDLState = 8210
ErrReorgPanic = 8211
ErrInvalidSplitRegionRanges = 8212
ErrInvalidDDLJobVersion = 8213
ErrCancelledDDLJob = 8214

// TiKV/PD errors.
ErrPDServerTimeout = 9001
ErrTiKVServerTimeout = 9002
Expand Down
15 changes: 15 additions & 0 deletions mysql/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,21 @@ var MySQLErrName = map[uint16]string{
ErrInvalidRecordKey: "invalid record key",
ErrUnsupportedValueForVar: "variable '%s' does not yet support value: %s",
ErrUnsupportedIsolationLevel: "The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error",
ErrInvalidDDLWorker: "Invalid DDL worker",
ErrUnsupportedDDLOperation: "Unsupported %s",
ErrNotOwner: "TiDB server is not a DDL owner",
ErrCantDecodeIndex: "Cannot decode index value, because %s",
ErrInvalidDDLJob: "Invalid DDL job",
ErrInvalidDDLJobFlag: "Invalid DDL job flag",
ErrWaitReorgTimeout: "Timeout waiting for data reorganization",
ErrInvalidStoreVersion: "Invalid storage current version: %d",
ErrUnknownTypeLength: "Unknown length for type %d",
ErrUnknownFractionLength: "Unknown length for type %d and fraction %d",
ErrInvalidDDLJobVersion: "Version %d of DDL job is greater than current one: %d",
ErrInvalidSplitRegionRanges: "Failed to split region ranges",
ErrReorgPanic: "Reorg worker panic",
ErrInvalidDDLState: "Invalid %s state: %v",
ErrCancelledDDLJob: "Cancelled DDL job",

// TiKV/PD errors.
ErrPDServerTimeout: "PD server timeout",
Expand Down

0 comments on commit 3b43b46

Please sign in to comment.