-
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
Bigint unsigned column value in CASE WHEN operator is converted to bigint signed #9869
Labels
Comments
Thanks for your report, @wjhuang2016 ! |
Confirming this issue still exists in master: drop table if exists t1;
create table t1(a int, b bigint unsigned);
insert into t1 (a, b) values (1,4572794622775114594), (2,18196094287899841997),(3,11120436154190595086);
select (case t1.a when 0 then 0 else t1.b end), cast(t1.b as signed) from t1;
..
mysql> select (case t1.a when 0 then 0 else t1.b end), cast(t1.b as signed) from t1;
+-----------------------------------------+----------------------+
| (case t1.a when 0 then 0 else t1.b end) | cast(t1.b as signed) |
+-----------------------------------------+----------------------+
| 4572794622775114594 | 4572794622775114594 |
| -250649785809709619 | -250649785809709619 |
| -7326307919518956530 | -7326307919518956530 |
+-----------------------------------------+----------------------+
3 rows in set (0.00 sec)
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-750-g8a661044c
Edition: Community
Git Commit Hash: 8a661044cedf8daad1de4fbf79a390962b6f6c3b
Git Branch: master
UTC Build Time: 2020-07-10 10:52:37
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) |
Closed
rogeryk
added a commit
to rogeryk/tidb
that referenced
this issue
Nov 15, 2020
…cap#9869) add ingegral promotion in AggFieldType
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!
If possible, provide a recipe for reproducing the error.
See also https://bugs.mysql.com/bug.php?id=79657
2. What did you expect to see?
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: