-
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
IFNULL
produce different result with MySQL on bigint column with unsigned flag
#17652
Labels
Comments
@shuke987 this happens only when the inserted data overflows the max value of signed int64, how about lower the severity to moderate or minor? TiDB(root@127.0.0.1:test) > create table t(x bigint unsigned);
Query OK, 0 rows affected (0.01 sec)
TiDB(root@127.0.0.1:test) > insert into t values(9999999703771440633);
Query OK, 1 row affected (0.00 sec)
TiDB(root@127.0.0.1:test) > insert into t values(9223372036854775807);
Query OK, 1 row affected (0.00 sec)
TiDB(root@127.0.0.1:test) > select ifnull(max(x), 0) from t;
+----------------------+
| ifnull(max(x), 0) |
+----------------------+
| -8446744369938110983 |
+----------------------+
1 row in set (0.01 sec)
TiDB(root@127.0.0.1:test) > select ifnull(x, 0) from t;
+----------------------+
| ifnull(x, 0) |
+----------------------+
| -8446744369938110983 |
| 9223372036854775807 |
+----------------------+
2 rows in set (0.01 sec) |
Can be closed by |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
result should be 9999999703771440633
3. What did you see instead (Required)
-8446744369938110983
4. Affected version (Required)
5. Root Cause Analysis
The text was updated successfully, but these errors were encountered: