Skip to content
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

Misleading error format in minus function #22749

Open
Tjianke opened this issue Feb 5, 2021 · 0 comments
Open

Misleading error format in minus function #22749

Tjianke opened this issue Feb 5, 2021 · 0 comments
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@Tjianke
Copy link
Contributor

Tjianke commented Feb 5, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set sql_mode='NO_UNSIGNED_SUBTRACTION';
select cast(13 as unsigned) - (-9223372036854775807);       
select  (-9223372036854775807) - cast(9223372036854775807 as unsigned);

2. What did you expect to see? (Required)

select cast(13 as unsigned) - (-9223372036854775807);                                                                                            
(1690, "BIGINT value is out of range in '(cast(13 as unsigned) - -(9223372036854775807))'")

select  (-9223372036854775807) - cast(9223372036854775807 as unsigned);                                                                          
(1690, "BIGINT value is out of range in '(-(9223372036854775807) - cast(9223372036854775807 as unsigned))'")

3. What did you see instead (Required)

select cast(13 as unsigned) - (-9223372036854775807);                                                                                            
(1690, "BIGINT value is out of range in '(13 + -9223372036854775807)'")
select  (-9223372036854775807) - cast(9223372036854775807 as unsigned);                                                                          
(1690, "BIGINT value is out of range in '(-9223372036854775807 + 9223372036854775807)'")

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2089-g0755feca8
Edition: Community
Git Commit Hash: 0755feca883fae44727db7da376f409cf2916f2e
Git Branch: refineWindowProcessor
UTC Build Time: 2021-01-31 07:15:08
GoVersion: go1.15.6
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false  
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants