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

incorrect result with mysql8 #22227

Open
xiongjiwei opened this issue Jan 6, 2021 · 5 comments
Open

incorrect result with mysql8 #22227

xiongjiwei opened this issue Jan 6, 2021 · 5 comments
Labels
severity/minor sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@xiongjiwei
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> select cast('2020-02-02' as datetime) > a from (select 'aa' as a) t;
+------------------------------------+
| cast('2020-02-02' as datetime) > a |
+------------------------------------+
|                                  1 |
+------------------------------------+
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------------------------------+
| Level   | Code | Message                                  |
+---------+------+------------------------------------------+
| Warning | 1292 | Truncated incorrect datetime value: 'aa' |
+---------+------+------------------------------------------+
1 row in set (0.00 sec)

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

as above

3. What did you see instead (Required)

mysql> select cast('2020-02-02' as datetime) > a from (select 'aa' as a) t;
+------------------------------------+
| cast('2020-02-02' as datetime) > a |
+------------------------------------+
|                               NULL |
+------------------------------------+
1 row in set, 1 warning (0.02 sec)

mysql>  show warnings;
+---------+------+--------------------------------+
| Level   | Code | Message                        |
+---------+------+--------------------------------+
| Warning | 1292 | Incorrect datetime value: 'aa' |
+---------+------+--------------------------------+
1 row in set (0.01 sec)

4. What is your TiDB version? (Required)

@ichn-hu
Copy link
Contributor

ichn-hu commented Jan 11, 2021

I think this is really an edge case, and it is not reasonable why a datetime is larger than a string? Do we really need to fix it?

@ichn-hu
Copy link
Contributor

ichn-hu commented Jan 11, 2021

I wound argue this bug should be a minor bug if not not a bug, according to bug severity standards

@ichn-hu
Copy link
Contributor

ichn-hu commented Jan 11, 2021

/unlabel severity/major

@ichn-hu
Copy link
Contributor

ichn-hu commented Jan 11, 2021

/label severity/minor

@ichn-hu
Copy link
Contributor

ichn-hu commented Jan 11, 2021

@aytrack let me know if you disagree

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

5 participants