-
Notifications
You must be signed in to change notification settings - Fork 489
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
parser: create integer type field with specified length should have warings #939
Conversation
Codecov Report
@@ Coverage Diff @@
## master #939 +/- ##
==========================================
- Coverage 78.46% 78.37% -0.09%
==========================================
Files 40 40
Lines 14913 14786 -127
==========================================
- Hits 11701 11589 -112
+ Misses 2521 2509 -12
+ Partials 691 688 -3 |
@@ -9634,6 +9634,10 @@ NumericType: | |||
// TODO: check flen 0 | |||
x := types.NewFieldType($1.(byte)) | |||
x.Flen = $2.(int) | |||
if $2.(int) != types.UnspecifiedLength { | |||
yylex.AppendError(yylex.Errorf("Integer display width is deprecated and will be removed in a future release.")) |
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.
Could we use ErrWarnDeprecatedIntegerDisplayWidth
directly?
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 can't use a terror
class directly in scanner here
ErrWarnDeprecatedIntegerDisplayWidth
is used in TiDB to append warnings in statement context to replace the raw warning, it contains the error code 1681, error message.
the raw message is like: "You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use near ''%s" Integer display width is deprecated and will be removed in a future release" and the fault error code is 1064
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
Cause ast.UnionStmt is removed in newer parser, but TiDB still referred the old version parser. That's why there is integation error. |
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
…arings (pingcap#939) * . Signed-off-by: AilinKid <314806019@qq.com> * . Signed-off-by: AilinKid <314806019@qq.com> * . Signed-off-by: AilinKid <314806019@qq.com> * . Signed-off-by: AilinKid <314806019@qq.com> * . Signed-off-by: AilinKid <314806019@qq.com>
What problem does this PR solve?
before
after
What is changed and how it works?
This is PR is part of the functionality above, it need TiDB PR to check the same warning and rewrite the error code and message.
Check List
Tests