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 |
| 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.
Could we use ErrWarnDeprecatedIntegerDisplayWidth directly?
There was a problem hiding this comment.
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
|
Cause ast.UnionStmt is removed in newer parser, but TiDB still referred the old version parser. That's why there is integation error. |
…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