Skip to content

Commit

Permalink
mysql,terror: add plugin error msg (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
lysu authored and jackysp committed Jan 14, 2019
1 parent 4e3eff2 commit c5c6ec2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
15 changes: 12 additions & 3 deletions mysql/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,9 +915,18 @@ const (
ErrWindowFunctionIgnoresFrame = 3599

// TiDB self-defined errors.
ErrMemExceedThreshold = 8001
ErrForUpdateCantRetry = 8002
ErrAdminCheckTable = 8003
ErrMemExceedThreshold = 8001
ErrForUpdateCantRetry = 8002
ErrAdminCheckTable = 8003
ErrInvalidPluginID = 8101
ErrInvalidPluginManifest = 8102
ErrInvalidPluginName = 8103
ErrInvalidPluginVersion = 8104
ErrDuplicatePlugin = 8105
ErrInvalidPluginSysVarName = 8106
ErrRequireVersionCheckFail = 8107
ErrUnsupportedReloadPlugin = 8018
ErrUnsupportedReloadPluginVar = 8019

// TiKV/PD errors.
ErrPDServerTimeout = 9001
Expand Down
10 changes: 10 additions & 0 deletions mysql/errname.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,16 @@ var MySQLErrName = map[uint16]string{
ErrForUpdateCantRetry: "[%d] can not retry select for update statement",
ErrAdminCheckTable: "TiDB admin check table failed.",

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",

// TiKV/PD errors.
ErrPDServerTimeout: "PD server timeout",
ErrTiKVServerTimeout: "TiKV server timeout",
Expand Down
2 changes: 2 additions & 0 deletions terror/terror.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const (
ClassJSON
ClassTiKV
ClassSession
ClassPlugin
// Add more as needed.
)

Expand Down Expand Up @@ -109,6 +110,7 @@ var errClz2Str = map[ErrClass]string{
ClassJSON: "json",
ClassTiKV: "tikv",
ClassSession: "session",
ClassPlugin: "plugin",
}

// String implements fmt.Stringer interface.
Expand Down

0 comments on commit c5c6ec2

Please sign in to comment.