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

0000-00-00 for date type cannot be select with is null #10538

Closed
lysu opened this issue May 20, 2019 · 1 comment
Closed

0000-00-00 for date type cannot be select with is null #10538

lysu opened this issue May 20, 2019 · 1 comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility

Comments

@lysu
Copy link
Contributor

lysu commented May 20, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
mysql> create table t1 (f1 date not null);
Query OK, 0 rows affected (0.02 sec)

mysql> set sql_mode='';
Query OK, 0 rows affected (0.00 sec)

mysql> insert into t1 values('0000-00-00');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t1 where f1 is null;
  1. What did you expect to see?

in mysql 5.7 will got

mysql> select * from t1 where f1 is null;
+------------+
| f1         |
+------------+
| 0000-00-00 |
+------------+
1 row in set (0.00 sec)
  1. What did you see instead?

in TiDB

mysql> select * from t1 where f1 is null;
Empty set (0.00 sec)

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v3.0.0-rc.1-85-g320d948e7
Git Commit Hash: 320d948e7d5c4bb03f947ff68a874985f36360da
Git Branch: test-master-tpcc
UTC Build Time: 2019-05-20 07:14:56
GoVersion: go version go1.12.1 linux/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false
@lysu lysu added type/compatibility help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels May 20, 2019
@lysu
Copy link
Contributor Author

lysu commented May 20, 2019

this question is found in test https://bugs.mysql.com/bug.php?id=14186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility
Projects
None yet
Development

No branches or pull requests

1 participant