-
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
ddl: wrong warning messages when running some DDL jobs. #38699
Comments
Since we are only storing one warning per warning code and a counter per unique warning code, I think we can change the warnings to something like:
|
/assign |
There may be 10,000 rows of data, such a row will definitely not fit mysql5.7/8.0: Query OK, 2 rows affected, 2 warnings (0.02 sec) Records: 2 Duplicates: 0 Warnings: 2 mysql> show warnings; +---------+------+--------------------------------------------+ | Level | Code | Message | +---------+------+--------------------------------------------+ | Warning | 1264 | Out of range value for column 'a' at row 1 | | Warning | 1264 | Out of range value for column 'a' at row 2 | +---------+------+--------------------------------------------+ |
@wxbty Thank you for being interested in this issue. IMHO it's fine for either @mjonss 's suggestion or the behavior of MySQL, but I think @mjonss is easier, that's it. |
ok |
@wxbty what I meant was literally say '$(count of the unique error code) warning(s), first warning: ...', not to concatenate all the warnings into a single column. And since we currently don't store each warning, just repeating the first warning over and over again is bad. |
I already understand. Will there be two different types of warnings? I haven't thought of it yet. This format needs to be changed, otherwise it will not be able to prompt the user. |
@wxbty how do you mean? To simplify I think we can just use what already exists (i.e. two different maps of ErrorID, one to the first warning string and the second to a counter). If the counter I think the related code is here Also I think we should update the documenation, clarifying that our warnings for DDLs may differ from MySQLs |
ok |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
I believe it can be reproduced in all TiDB versions that support modifying the column as above.
Also, this issue should be reproduced for all other types of DDLs as long as multiple warnings might be raised.
The text was updated successfully, but these errors were encountered: