我们如何允许MySQL存储无效日期?

在将SQL模式启用为ALLOW_INVALID_DATES之后,MySQL也将能够在表中存储无效日期。下面给出的例子来理解它-

mysql> Insert into order1234(ProductName, Quantity, Orderdate) values('B',500,'2015-11-31');

mysql> Select * from order1234;
+-------------+----------+--------------+
| ProductName | Quantity | OrderDate    |
+-------------+----------+--------------+
| A           | 500      | 0000-00-00   |
| B           | 500      | 2015-11-31   |
+-------------+----------+--------------+
2 rows in set (0.00 sec)

我们可以看到MySQL还在表中插入了无效的日期。