-
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
Wrong result for cast expr when value exceeds range #32213
Comments
Also exists for decimal to decimal:
tidb:
mysql:
|
This bug has existed for a long time. The oldest version I have tested is v3.0.(Maybe this bug exists on all versions) |
/severity major |
I wasted some time comparing the Finally, I found the bug after comparing the code between https://github.com/mysql/mysql-server/blob/0cd98bdf981583a1cf4cb526581fc16e23bb839b/sql/item_func.cc#L1725-L1751 and Lines 1426 to 1459 in e130e52
The root cause is that the judgment of digit length should be after calling |
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)
The text was updated successfully, but these errors were encountered: