Skip to content

Commit

Permalink
mysql: clean up unused TiDB errcode (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao authored Mar 11, 2020
1 parent f89bb53 commit 300cc00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 228 deletions.
123 changes: 7 additions & 116 deletions mysql/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,121 +961,12 @@ const (
ErrSequenceInvalidTableStructure = 4141

// TiDB self-defined errors.
ErrMemExceedThreshold = 8001
ErrForUpdateCantRetry = 8002
ErrAdminCheckTable = 8003
ErrTxnTooLarge = 8004
ErrWriteConflictInTiDB = 8005
ErrUnsupportedReloadPlugin = 8018
ErrUnsupportedReloadPluginVar = 8019
ErrTableLocked = 8020
ErrNotExist = 8021
ErrTxnRetryable = 8022
ErrCannotSetNilValue = 8023
ErrInvalidTxn = 8024
ErrEntryTooLarge = 8025
ErrNotImplemented = 8026
ErrInfoSchemaExpired = 8027
ErrInfoSchemaChanged = 8028
ErrBadNumber = 8029
ErrCastAsSignedOverflow = 8030
ErrCastNegIntAsUnsigned = 8031
ErrInvalidYearFormat = 8032
ErrInvalidYear = 8033
ErrIncorrectDatetimeValue = 8034
ErrInvalidTimeFormat = 8036
ErrInvalidWeekModeFormat = 8037
ErrFieldGetDefaultFailed = 8038
ErrIndexOutBound = 8039
ErrUnsupportedOp = 8040
ErrRowNotFound = 8041
ErrTableStateCantNone = 8042
ErrColumnStateNonPublic = 8043
ErrIndexStateCantNone = 8044
ErrInvalidRecordKey = 8045
ErrColumnStateCantNone = 8046
ErrUnsupportedValueForVar = 8047
ErrUnsupportedIsolationLevel = 8048
ErrLoadPrivilege = 8049
ErrInvalidPrivilegeType = 8050
ErrUnknownFieldType = 8051
ErrInvalidSequence = 8052
ErrCantGetValidID = 8053
ErrCantSetToNull = 8054
ErrSnapshotTooOld = 8055
ErrInvalidTableID = 8056
ErrInvalidType = 8057
ErrUnknownAllocatorType = 8058
ErrAutoRandReadFailed = 8059
ErrInvalidIncrementAndOffset = 8060
ErrWarnOptimizerHintUnsupportedHint = 8061
ErrWarnOptimizerHintInvalidToken = 8062
ErrWarnMemoryQuotaOverflow = 8063
ErrWarnOptimizerHintParseError = 8064
ErrWarnOptimizerHintInvalidInteger = 8065
ErrUnsupportedSecondArgumentType = 8066
ErrInvalidPluginID = 8101
ErrInvalidPluginManifest = 8102
ErrInvalidPluginName = 8103
ErrInvalidPluginVersion = 8104
ErrDuplicatePlugin = 8105
ErrInvalidPluginSysVarName = 8106
ErrRequireVersionCheckFail = 8107
ErrUnsupportedType = 8108
ErrAnalyzeMissIndex = 8109
ErrCartesianProductUnsupported = 8110
ErrPreparedStmtNotFound = 8111
ErrWrongParamCount = 8112
ErrSchemaChanged = 8113
ErrUnknownPlan = 8114
ErrPrepareMulti = 8115
ErrPrepareDDL = 8116
ErrResultIsEmpty = 8117
ErrBuildExecutor = 8118
ErrBatchInsertFail = 8119
ErrGetStartTS = 8120
ErrPrivilegeCheckFail = 8121
ErrInvalidWildCard = 8122
ErrMixOfGroupFuncAndFieldsIncompatible = 8123
ErrWarnOptimizerHintUnsupportedHint = 8061
ErrWarnOptimizerHintInvalidToken = 8062
ErrWarnMemoryQuotaOverflow = 8063
ErrWarnOptimizerHintParseError = 8064
ErrWarnOptimizerHintInvalidInteger = 8065

// 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
ErrRepairTable = 8215
ErrInvalidAutoRandom = 8216
ErrInvalidHashKeyFlag = 8217
ErrInvalidListIndex = 8218
ErrInvalidListMetaData = 8219
ErrWriteOnSnapshot = 8220
ErrInvalidKey = 8221
ErrInvalidIndexKey = 8222
ErrDataInConsistent = 8223
ErrDDLJobNotFound = 8224
ErrCancelFinishedDDLJob = 8225
ErrCannotCancelDDLJob = 8226
ErrSequenceUnsupportedTableOption = 8227
ErrColumnTypeUnsupportedNextValue = 8228

// TiKV/PD errors.
ErrPDServerTimeout = 9001
ErrTiKVServerTimeout = 9002
ErrTiKVServerBusy = 9003
ErrResolveLockTimeout = 9004
ErrRegionUnavailable = 9005
ErrGCTooEarly = 9006
ErrWriteConflict = 9007
ErrTiKVStoreLimit = 9008
// Stop adding error code here!
// They are moved to github.com/pingcap/tidb/errno
)
112 changes: 0 additions & 112 deletions mysql/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,121 +958,9 @@ var MySQLErrName = map[uint16]string{
ErrSequenceInvalidTableStructure: "Sequence '%-.64s.%-.64s' table structure is invalid (%s)",

// TiDB errors.
ErrMemExceedThreshold: "%s holds %dB memory, exceeds threshold %dB.%s",
ErrForUpdateCantRetry: "[%d] can not retry select for update statement",
ErrAdminCheckTable: "TiDB admin check table failed.",
ErrTxnTooLarge: "Transaction is too large, size: %d",
ErrWriteConflictInTiDB: "Write conflict, txnStartTS %d is stale",
ErrInvalidPluginID: "Wrong plugin id: %s, valid plugin id is [name]-[version], both name and version should not contain '-'",
ErrInvalidPluginManifest: "Cannot read plugin %s's manifest",
ErrInvalidPluginName: "Plugin load with %s but got wrong name %s",
ErrInvalidPluginVersion: "Plugin load with %s but got %s",
ErrDuplicatePlugin: "Plugin [%s] is redeclared",
ErrInvalidPluginSysVarName: "Plugin %s's sysVar %s must start with its plugin name %s",
ErrRequireVersionCheckFail: "Plugin %s require %s be %v but got %v",
ErrUnsupportedReloadPlugin: "Plugin %s isn't loaded so cannot be reloaded",
ErrUnsupportedReloadPluginVar: "Reload plugin with different sysVar is unsupported %v",
ErrTableLocked: "Table '%s' was locked in %s by %v",
ErrNotExist: "Error: key not exist",
ErrTxnRetryable: "Error: KV error safe to retry %s ",
ErrCannotSetNilValue: "can not set nil value",
ErrInvalidTxn: "invalid transaction",
ErrEntryTooLarge: "entry too large, the max entry size is %d, the size of data is %d",
ErrNotImplemented: "not implemented",
ErrInfoSchemaExpired: "Information schema is out of date: schema failed to update in 1 lease, please make sure TiDB can connect to TiKV",
ErrInfoSchemaChanged: "Information schema is changed during the execution of the statement(for example, table definition may be updated by other DDL ran in parallel). If you see this error often, try increasing `tidb_max_delta_schema_count`",
ErrBadNumber: "Bad Number",
ErrCastAsSignedOverflow: "Cast to signed converted positive out-of-range integer to it's negative complement",
ErrCastNegIntAsUnsigned: "Cast to unsigned converted negative integer to it's positive complement",
ErrInvalidYearFormat: "invalid year format",
ErrInvalidYear: "invalid year",
ErrIncorrectDatetimeValue: "Incorrect datetime value: '%s'",
ErrInvalidTimeFormat: "invalid time format: '%v'",
ErrInvalidWeekModeFormat: "invalid week mode format: '%v'",
ErrFieldGetDefaultFailed: "Field '%s' get default value fail",
ErrIndexOutBound: "Index column %s offset out of bound, offset: %d, row: %v",
ErrUnsupportedOp: "operation not supported",
ErrRowNotFound: "can not find the row: %s",
ErrTableStateCantNone: "table %s can't be in none state",
ErrColumnStateCantNone: "column %s can't be in none state",
ErrColumnStateNonPublic: "can not use non-public column",
ErrIndexStateCantNone: "index %s can't be in none state",
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",
ErrRepairTable: "Failed to repair table: %s",
ErrLoadPrivilege: "Load privilege table fail: %s",
ErrInvalidPrivilegeType: "unknown privilege type %s",
ErrUnknownFieldType: "unknown field type",
ErrInvalidSequence: "invalid sequence",
ErrInvalidType: "invalid type",
ErrCantGetValidID: "Cannot get a valid auto-ID when retrying the statement",
ErrCantSetToNull: "cannot set variable to null",
ErrSnapshotTooOld: "snapshot is older than GC safe point %s",
ErrInvalidTableID: "invalid TableID",
ErrInvalidAutoRandom: "Invalid auto random: %s",
ErrInvalidHashKeyFlag: "invalid encoded hash key flag",
ErrInvalidListIndex: "invalid list index",
ErrInvalidListMetaData: "invalid list meta data",
ErrWriteOnSnapshot: "write on snapshot",
ErrInvalidKey: "invalid key",
ErrInvalidIndexKey: "invalid index key",
ErrDataInConsistent: "data isn't equal",
ErrDDLJobNotFound: "DDL Job:%v not found",
ErrCancelFinishedDDLJob: "This job:%v is finished, so can't be cancelled",
ErrCannotCancelDDLJob: "This job:%v is almost finished, can't be cancelled now",
ErrUnknownAllocatorType: "Invalid allocator type",
ErrAutoRandReadFailed: "Failed to read auto-random value from storage engine",
ErrInvalidIncrementAndOffset: "Invalid auto_increment settings: auto_increment_increment: %d, auto_increment_offset: %d, both of them must be in range [1..65535]",

ErrWarnOptimizerHintInvalidInteger: "integer value is out of range in '%s'",
ErrWarnOptimizerHintUnsupportedHint: "Optimizer hint %s is not supported by TiDB and is ignored",
ErrWarnOptimizerHintInvalidToken: "Cannot use %s '%s' (tok = %d) in an optimizer hint",
ErrWarnMemoryQuotaOverflow: "Max value of MEMORY_QUOTA is %d bytes, ignore this invalid limit",
ErrWarnOptimizerHintParseError: "Optimizer hint syntax error at %v",

ErrSequenceUnsupportedTableOption: "Unsupported sequence table-option %s",
ErrColumnTypeUnsupportedNextValue: "Unsupported sequence default value for column type '%s'",
ErrUnsupportedType: "Unsupported type %T",
ErrAnalyzeMissIndex: "Index '%s' in field list does not exist in table '%s'",
ErrCartesianProductUnsupported: "Cartesian product is unsupported",
ErrPreparedStmtNotFound: "Prepared statement not found",
ErrWrongParamCount: "Wrong parameter count",
ErrSchemaChanged: "Schema has changed",
ErrUnknownPlan: "Unknown plan",
ErrPrepareMulti: "Can not prepare multiple statements",
ErrPrepareDDL: "Can not prepare DDL statements with parameters",
ErrResultIsEmpty: "Result is empty",
ErrBuildExecutor: "Failed to build executor",
ErrBatchInsertFail: "Batch insert failed, please clean the table and try again.",
ErrGetStartTS: "Can not get start ts",
ErrPrivilegeCheckFail: "privilege check fail", // this error message should begin lowercased to be compatible with the test
ErrInvalidWildCard: "Wildcard fields without any table name appears in wrong place",
ErrMixOfGroupFuncAndFieldsIncompatible: "In aggregated query without GROUP BY, expression #%d of SELECT list contains nonaggregated column '%s'; this is incompatible with sql_mode=only_full_group_by",
ErrUnsupportedSecondArgumentType: "JSON_OBJECTAGG: unsupported second argument type %v",

// TiKV/PD errors.
ErrPDServerTimeout: "PD server timeout",
ErrTiKVServerTimeout: "TiKV server timeout",
ErrTiKVServerBusy: "TiKV server is busy",
ErrResolveLockTimeout: "Resolve lock timeout",
ErrRegionUnavailable: "Region is unavailable",
ErrGCTooEarly: "GC life time is shorter than transaction duration, transaction starts at %v, GC safe point is %v",
ErrWriteConflict: "Write conflict, txnStartTS=%d, conflictStartTS=%d, conflictCommitTS=%d, key=%s",
ErrTiKVStoreLimit: "Store token is up to the limit, store id = %d",
}

0 comments on commit 300cc00

Please sign in to comment.