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

Inconsistenet error reporting format with MySQL #22399

Open
Tjianke opened this issue Jan 14, 2021 · 4 comments
Open

Inconsistenet error reporting format with MySQL #22399

Tjianke opened this issue Jan 14, 2021 · 4 comments
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@Tjianke
Copy link
Contributor

Tjianke commented Jan 14, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

 select cast(-1 as unsigned) + 9223372036854775808;

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

(1690, "BIGINT UNSIGNED value is out of range in '(cast(-(1) as unsigned) + 9223372036854775808)'")

3. What did you see instead (Required)

(1690, "BIGINT UNSIGNED value is out of range in '(18446744073709551615 + 9223372036854775808)'")

4. What is your TiDB version? (Required)

+-------------------------------------------------------------------+
| tidb_version()                                                    |
+-------------------------------------------------------------------+
| Release Version: v4.0.0-beta.2-2016-g3dd842f50                    |
| Edition: Community                                                |
| Git Commit Hash: 3dd842f50a75ebbf9a4f9d7b30fb2ce8a8dd4b37         |
| Git Branch: master                                                |
| UTC Build Time: 2021-01-13 14:08:28                               |
| GoVersion: go1.15.5                                               |
| Race Enabled: false                                               |
| TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306 |
| Check Table Before Drop: false                                    |
+-------------------------------------------------------------------+
@Tjianke Tjianke added the type/bug The issue is confirmed as a bug. label Jan 14, 2021
@cyliu0
Copy link
Contributor

cyliu0 commented Jan 15, 2021

It looks like the similar issues you filed yesterday. Can we merge all of them into one?

@Tjianke
Copy link
Contributor Author

Tjianke commented Jan 15, 2021

It looks like the similar issues you filed yesterday. Can we merge all of them into one?

Well, to be precise, this issue is a compatibility issue with MySQL(sry could not find a compatibility category in issue, so I used bug category instead). Other issues I raised before are actually bugs, where errors should raise.

However, I think it may be more concise if we merge those two bug issues together and left this compatibility issue alone?

@Tjianke
Copy link
Contributor Author

Tjianke commented Jan 18, 2021

Seems like this issue won't have a quick fix, due to the fact that incompatbility raises from this line:

return types.ErrOverflow.GenWithStackByArgs("BIGINT UNSIGNED", fmt.Sprintf("(%s - %s)", b.args[0].String(), b.args[1].String()))

b.args[1].String() could only return the eventual parsed value of an expression instead of original args in SQL query(what MySQL is returning).

@Tjianke
Copy link
Contributor Author

Tjianke commented Jan 31, 2021

same issue as #11181

@jebter jebter added this to the v5.0.0 ga milestone Mar 20, 2021
@zimulala zimulala removed this from the v5.0.0 ga milestone Mar 23, 2021
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

No branches or pull requests

4 participants