Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql,terror: add plugin error msg (#173) #257

Merged
merged 1 commit into from
Mar 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions mysql/errcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,18 @@ const (
ErrJSONUsedAsKey = 3152

// 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 @@ -895,6 +895,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