Tidb: Insert zero date successfully in default sql mode

Created on 24 Jul 2019  路  3Comments  路  Source: pingcap/tidb

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.
create table t(a date);
insert into t values('0000-00-0');

Relate issue: #8637

  1. What did you expect to see?
mysql> create table t(a date);
Query OK, 0 rows affected (0.07 sec)

mysql> insert into t values('0000-00-0');
ERROR 1292 (22007): Incorrect date value: '0000-00-0' for column 'a' at row 1
  1. What did you see instead?
mysql> create table t(a date);
Query OK, 0 rows affected (0.01 sec)

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

mysql> select * from t;
+------------+
| a          |
+------------+
| 0000-00-00 |
+------------+
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
typbug

Most helpful comment

Thanks for your report, @wjhuang2016 ! Would you want to fix it?

Yeah, I will try to fix it.

All 3 comments

Thanks for your report, @wjhuang2016 ! Would you want to fix it?

Thanks for your report, @wjhuang2016 ! Would you want to fix it?

Yeah, I will try to fix it.

Thanks, @wjhuang2016 !

Was this page helpful?
0 / 5 - 0 ratings