-
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
types: add error code for package types #13300
Conversation
7892680
to
3785a62
Compare
Codecov Report
@@ Coverage Diff @@
## master #13300 +/- ##
===========================================
Coverage 80.3224% 80.3224%
===========================================
Files 474 474
Lines 117677 117677
===========================================
Hits 94521 94521
Misses 15743 15743
Partials 7413 7413 |
LGTM, the |
/run-all-tests |
b27df16
to
70357b3
Compare
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
70357b3
to
813f7b7
Compare
/run-all-tests tidb-test=pr/946 |
/run-all-tests tidb-test=pr/946 |
2 similar comments
/run-all-tests tidb-test=pr/946 |
/run-all-tests tidb-test=pr/946 |
Thank you for the reminder, @cfzjywxk PTAL. |
PTAL @lysu |
PTAL @bb7133 |
colTp byte | ||
colName string | ||
) | ||
if col != nil { |
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.
if col == nil
does following code will generate error message use unspecified type and '' column name?
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.
yes...
/run-all-tests tidb-test=pr/946 |
PTAL @zimulala |
2 similar comments
LGTM |
@@ -105,9 +105,9 @@ func (s *testSuite5) TestShowWarnings(c *C) { | |||
tk.MustExec("set @@sql_mode=''") | |||
tk.MustExec("insert show_warnings values ('a')") | |||
c.Assert(tk.Se.GetSessionVars().StmtCtx.WarningCount(), Equals, uint16(1)) | |||
tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1265|Data Truncated")) | |||
tk.MustQuery("show warnings").Check(testutil.RowsWithSep("|", "Warning|1292|Truncated incorrect FLOAT value: 'a'")) |
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.
In MySQL, I test this case, but it result is as follows:
mysql> create table if not exists show_warnings (a int);
Query OK, 0 rows affected (0.06 sec)
mysql> set @@sql_mode='';
Query OK, 0 rows affected (0.01 sec)
mysql> insert show_warnings values ('a');
Query OK, 1 row affected, 1 warning (0.01 sec)
mysql> show warnings;
+---------+------+------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------+
| Warning | 1366 | Incorrect integer value: 'a' for column 'a' at row 1 |
+---------+------+------------------------------------------------------+
1 row in set (0.00 sec)
Do we need to update this error code?
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.
It is difficult for us to be completely consistent with MySQL in terms of error codes and error messages. What I want to do is to keep us self-consistent, the unique error code + reasonable error message. I think it can help users search the MySQL manual to find the problem if we use the code which MySQL also has (maybe not the same in the same scenes). If want to be completely consistent, I don't feel I can do it. :)
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 |
@jackysp merge failed. |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
/merge |
/run-all-tests |
@jackysp merge failed. |
/merge |
Your auto merge job has been accepted, waiting for 13745, 13527 |
/run-all-tests |
@jackysp merge failed. |
Signed-off-by: Shuaipeng Yu jackysp@gmail.com
What problem does this PR solve?
Add error code for package types.
What is changed and how it works?
Check List
Tests
Code changes
Side effects