-
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
table: format table error code and error message #13233
Conversation
d4e9ea7
to
df76224
Compare
Codecov Report
@@ Coverage Diff @@
## master #13233 +/- ##
================================================
- Coverage 80.4067% 80.1497% -0.2571%
================================================
Files 475 475
Lines 118893 117671 -1222
================================================
- Hits 95598 94313 -1285
- Misses 15843 15894 +51
- Partials 7452 7464 +12 |
table/table.go
Outdated
// ErrTruncateWrongValue returns for truncate wrong value for field. | ||
ErrTruncateWrongValue = terror.ClassTable.New(codeTruncateWrongValue, "incorrect value") | ||
ErrTruncateWrongValue = terror.ClassTable.New(mysql.ErrTruncatedWrongValueForField, mysql.MySQLErrName[mysql.ErrTruncatedWrongValueForField]) |
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.
this is duplicated with ErrTruncatedWrongValueForField
~? and maybe need to change the caller too?
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.
fixed
errDuplicateColumn = terror.ClassTable.New(codeDuplicateColumn, "duplicate column") | ||
ErrColumnCantNull = terror.ClassTable.New(mysql.ErrBadNull, mysql.MySQLErrName[mysql.ErrBadNull]) | ||
errUnknownColumn = terror.ClassTable.New(mysql.ErrBadField, mysql.MySQLErrName[mysql.ErrBadField]) | ||
errDuplicateColumn = terror.ClassTable.New(mysql.ErrFieldSpecifiedTwice, mysql.MySQLErrName[mysql.ErrFieldSpecifiedTwice]) |
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.
maybe need change the caller of errUnknownColumn
, errDuplicateColumn
due to "%" changed in message?
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.
But share same error code may be confused.
ee286f3
to
98f6bdf
Compare
5acfb41
to
e106135
Compare
/run-all-tests tidb-test=pr/932 |
641b2bb
to
be62df3
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
/run-all-tests |
f7c257a
to
d0d547a
Compare
/run-all-tests -tidb-test=pr/962 |
/run-unit-test |
/run-all-tests |
@imtbkcat merge failed. |
/merge |
Your auto merge job has been accepted, waiting for 13124 |
/run-all-tests |
cherry pick to release-2.1 failed |
cherry pick to release-3.0 failed |
It seems that, not for sure, we failed to cherry-pick this commit to release-2.1 release-3.0. Please comment '/run-cherry-picker' to try to trigger the cherry-picker if we did fail to cherry-pick this commit before. @imtbkcat PTAL. |
What problem does this PR solve?
Not all the errors in table package have error code.
What is changed and how it works?
Add error code for these errors and format these error messages.
Check List
Tests
Code changes
Side effects
Related changes
Release note