Skip to content

Commit 3b43b46

Browse files
authored
mysql: add ddl-related error code and name (#630)
1 parent e3789d9 commit 3b43b46

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

mysql/errcode.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,23 @@ const (
975975
ErrUnsupportedValueForVar = 8047
976976
ErrUnsupportedIsolationLevel = 8048
977977

978+
// Error codes used by TiDB ddl package
979+
ErrUnsupportedDDLOperation = 8200
980+
ErrNotOwner = 8201
981+
ErrCantDecodeIndex = 8202
982+
ErrInvalidDDLWorker = 8203
983+
ErrInvalidDDLJob = 8204
984+
ErrInvalidDDLJobFlag = 8205
985+
ErrWaitReorgTimeout = 8206
986+
ErrInvalidStoreVersion = 8207
987+
ErrUnknownTypeLength = 8208
988+
ErrUnknownFractionLength = 8209
989+
ErrInvalidDDLState = 8210
990+
ErrReorgPanic = 8211
991+
ErrInvalidSplitRegionRanges = 8212
992+
ErrInvalidDDLJobVersion = 8213
993+
ErrCancelledDDLJob = 8214
994+
978995
// TiKV/PD errors.
979996
ErrPDServerTimeout = 9001
980997
ErrTiKVServerTimeout = 9002

mysql/errname.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,21 @@ var MySQLErrName = map[uint16]string{
970970
ErrInvalidRecordKey: "invalid record key",
971971
ErrUnsupportedValueForVar: "variable '%s' does not yet support value: %s",
972972
ErrUnsupportedIsolationLevel: "The isolation level '%s' is not supported. Set tidb_skip_isolation_level_check=1 to skip this error",
973+
ErrInvalidDDLWorker: "Invalid DDL worker",
974+
ErrUnsupportedDDLOperation: "Unsupported %s",
975+
ErrNotOwner: "TiDB server is not a DDL owner",
976+
ErrCantDecodeIndex: "Cannot decode index value, because %s",
977+
ErrInvalidDDLJob: "Invalid DDL job",
978+
ErrInvalidDDLJobFlag: "Invalid DDL job flag",
979+
ErrWaitReorgTimeout: "Timeout waiting for data reorganization",
980+
ErrInvalidStoreVersion: "Invalid storage current version: %d",
981+
ErrUnknownTypeLength: "Unknown length for type %d",
982+
ErrUnknownFractionLength: "Unknown length for type %d and fraction %d",
983+
ErrInvalidDDLJobVersion: "Version %d of DDL job is greater than current one: %d",
984+
ErrInvalidSplitRegionRanges: "Failed to split region ranges",
985+
ErrReorgPanic: "Reorg worker panic",
986+
ErrInvalidDDLState: "Invalid %s state: %v",
987+
ErrCancelledDDLJob: "Cancelled DDL job",
973988

974989
// TiKV/PD errors.
975990
ErrPDServerTimeout: "PD server timeout",

0 commit comments

Comments
 (0)