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

Wrong behavior on builtin function truncate #7615

Closed
winoros opened this issue Sep 5, 2018 · 1 comment · Fixed by #8000
Closed

Wrong behavior on builtin function truncate #7615

winoros opened this issue Sep 5, 2018 · 1 comment · Fixed by #8000
Labels
component/expression good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug.

Comments

@winoros
Copy link
Member

winoros commented Sep 5, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.

select truncate(9223372036854775808, -10);

TiDB don't handle the unsigned int case of this function.

  1. What did you expect to see?
+------------------------------------+
| truncate(9223372036854775808, -10) |
+------------------------------------+
|                9223372030000000000 |
+------------------------------------+
  1. What did you see instead?
mysql> select truncate(9223372036854775808, -10);
+------------------------------------+
| truncate(9223372036854775808, -10) |
+------------------------------------+
|                9223372043709551616 |
+------------------------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?

master branch 129f499

@winoros winoros added type/bug The issue is confirmed as a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. component/expression labels Sep 5, 2018
@winoros
Copy link
Member Author

winoros commented Sep 5, 2018

closed since duplicated with #7591

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/expression good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants