-
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
ddl: fix error code and error name #13329
Conversation
7adf445
to
b4e6561
Compare
PTAL @jackysp |
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.
LGTM
ddl/ddl.go
Outdated
// ErrInvalidTableState returns for invalid Table state. | ||
ErrInvalidTableState = terror.ClassDDL.New(codeInvalidTableState, "invalid table state") | ||
ErrInvalidTableState = terror.ClassDDL.New(mysql.ErrInvalidDDLState, fmt.Sprintf(mysql.MySQLErrName[mysql.ErrInvalidDDLState], "table")) |
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.
Do we need to change the way it is used?
Now we use it like ErrInvalidTableState.GenWithStack("invalid table state %v", tbInfo.State)
. I think we can use it like ErrInvalidTableState.GenWithStackByArgs(...)
in this PR.
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.
Done, thanks
a7ebd44
to
78aa493
Compare
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.
LGTM
78aa493
to
a7c10d0
Compare
Codecov Report
@@ Coverage Diff @@
## master #13329 +/- ##
===========================================
Coverage 80.3502% 80.3502%
===========================================
Files 469 469
Lines 113793 113793
===========================================
Hits 91433 91433
Misses 15309 15309
Partials 7051 7051 |
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.
LGTM
/run-all-tests |
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.
Approve
@bb7133 merge failed. |
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.
LGTM
mysql-test need to be updated as well |
/run-all-tests tidb-test=pr/945 |
What problem does this PR solve?
This PR refines all
Error
s defined inddl/ddl.go
:1105(Unknown)
error code.8060
for all errors caused by invalid DDL object state, for example,ErrInvalidTableState
andErrInvalidDatabaseState
shares error code8060
.8050
for most errors that caused by the operations that TiDB not supported yet, for example,errRunMultiSchemaChanges
anderrCantDropColWithIndex
.Related Parser PR: pingcap/parser#630
What is changed and how it works?
NA
Check List
Tests
Code changes
Side effects