-
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
TiDB's warning logs for "Data Truncated" Error are not friendly. #5777
Comments
@mz1999 Thanks for your feed back ! We are working on this currently. |
Here is a test-case which uses sql only:
I ran this against master, and the following was written to the log file:
I actually think that this is correct for at least
|
The warning has changed slightly in TiDB (incorrect): +---------+------+-------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------+
| Warning | 1292 | Truncated incorrect DECIMAL value: '2.16' |
+---------+------+-------------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-870-g2a8b96845
Edition: Community
Git Commit Hash: 2a8b968453520e4fcf9d6ff46c9f23b4ad23feee
Git Branch: master
UTC Build Time: 2020-07-31 08:45:35
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
Seems to still affect the latest master:
|
So this started as a enhancement as |
Please answer these questions before submitting your issue. Thanks!
I encountered the same error as #5532, but my concern is that the server side warning logs for "Data Truncated" error are not friendly, which caused a lot of trouble in locating the root reason.
Java Code snippet:
Note: set
useServerPrepStmts=true
, using Server Prepared StatementsMySQL Connector/J version:
I expected TiDB's server side warning logs to point out the SQL statement which caused the error.
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: