-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: fix some error related issues #4032
Conversation
LGTM |
@@ -257,7 +257,7 @@ func (e *Error) NotEqual(err error) bool { | |||
// ToSQLError convert Error to mysql.SQLError. | |||
func (e *Error) ToSQLError() *mysql.SQLError { | |||
code := e.getMySQLErrorCode() | |||
return mysql.NewErrf(code, e.getMsg()) | |||
return mysql.NewErrf(code, "%s", e.getMsg()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use mysql.NewErr() here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shenli mysql.NewErr
cannot be used here. It's functionality is not what we usually expected to be:
mysql.NewErr: NewErr generates a SQL error, with an error code and default format specifier defined in MySQLErrName.
func NewErr(errCode uint16, args ...interface{}) *SQLError
mysql.NewErrf: NewErrf creates a SQL error, with an error code and a format specifier.
func NewErrf(errCode uint16, format string, args ...interface{}) *SQLError
@breeswish Please resolve the conflicts. |
@shenli Done |
LGTM |
Fix: