-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
util: rewrite parser warings for integer display width #18775
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18775 +/- ##
===========================================
Coverage 79.3811% 79.3811%
===========================================
Files 546 546
Lines 148219 148219
===========================================
Hits 117658 117658
Misses 21078 21078
Partials 9483 9483 |
To clarify, this is a MySQL 8.0 compatible behavior, not a MySQL 5.7 one: mysql [localhost:5731] {msandbox} (test) > CREATE TABLE t1 (id int(10) not null);
Query OK, 0 rows affected (0.02 sec)
mysql [localhost:5731] {msandbox} (test) > SHOW WARNINGS;
Empty set (0.00 sec)
..
mysql [localhost:8021] {msandbox} (test) > CREATE TABLE t1 (id int(10) not null);
Query OK, 0 rows affected, 1 warning (0.03 sec)
mysql [localhost:8021] {msandbox} (test) > show warnings;
+---------+------+------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------+
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
+---------+------+------------------------------------------------------------------------------+
1 row in set (0.00 sec) Looking at this patch, it looks like it doesn't modify There is still a use-case in MySQL to use integer display width because of See also: #17682 |
So that means we should fix the integer display length in the output of |
I wanna do it in another PR. |
/run-unit-test |
I think it is important that a CREATE TABLE -> SHOW CREATE TABLE -> CREATE TABLE doesn't produce warnings. Perhaps in terms of simplifying PRs:
What do you think? (The actual setting name may need some discussion. There is nothing else called |
Sounds great |
c90282c
to
7a14aa6
Compare
PTAL @tangenta @djshow832 @zimulala |
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
Signed-off-by: AilinKid <314806019@qq.com>
5f926f5
to
8f8d881
Compare
Signed-off-by: AilinKid <314806019@qq.com>
786ffe4
to
f9c7037
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-check_dev_2 |
/run-unit-test |
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
@@ -5298,3 +5299,59 @@ func init() { | |||
domain.SchemaOutOfDateRetryInterval = int64(50 * time.Millisecond) | |||
domain.SchemaOutOfDateRetryTimes = int32(50) | |||
} | |||
|
|||
func (s *testSerialDBSuite) TestCreateTableWithIntegerLengthWaring(c *C) { |
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.
func (s *testSerialDBSuite) TestCreateTableWithIntegerLengthWaring(c *C) { | |
func (s *testSerialDBSuite) TestCreateTableWithIntegerLengthWarning(c *C) { |
/run-all-tests |
/run-common-test |
/run-integration-ddl-test |
/run-common-test |
/run-integration-ddl-test |
Signed-off-by: AilinKid 314806019@qq.com
What problem does this PR solve?
The linked Parser: pingcap/parser#939
Problem Summary: For integerType:
if they are followed with
(num)
to specify the length, it should have the warningsWhat is changed and how it works?
How it Works:
mark the warings in parser, rewrite the parser with terror class {errcode 1681, errmsg "xxx"} in TiDB
Check List
Tests
Release note