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

Merged
merged 4 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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: "Can not read plugin %s's manifest",
lysu marked this conversation as resolved.
Show resolved Hide resolved
ErrInvalidPluginName: "Plugin load with %s but got wrong name %s",
ErrInvalidPluginVersion: "Plugin load with %s but got %s",
ErrDuplicatePlugin: "Plugin [%s] be duplicate declared in init parameters",
lysu marked this conversation as resolved.
Show resolved Hide resolved
ErrInvalidPluginSysVarName: "Plugin %s's sysVar %s must be prefix with plugin name %s",
lysu marked this conversation as resolved.
Show resolved Hide resolved
ErrRequireVersionCheckFail: "Plugin %s require %s be %v but got %v",
ErrUnsupportedReloadPlugin: "Plugin %s isn't loaded so can not reload",
lysu marked this conversation as resolved.
Show resolved Hide resolved
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