How MySQL deals with incorrect date value
mysql>
mysql> CREATE TABLE INCORRECT_DATES (COLUMN1 DATE);
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> INSERT INTO INCORRECT_DATES VALUES ('2004-13-12');
Query OK, 1 row affected, 1 warning (0.00 sec)
mysql>
mysql> SELECT COLUMN1 FROM INCORRECT_DATES;
+------------+
| COLUMN1 |
+------------+
| 0000-00-00 |
+------------+
1 row in set (0.00 sec)
mysql>
mysql> CREATE TABLE TIME_TABLE (COLUMN1 TIME);
mysql>
mysql> INSERT INTO TIME_TABLE VALUES ('23:59:59.5912');
Query OK, 1 row affected (0.00 sec)
mysql>
mysql> SELECT COLUMN1 FROM TIME_TABLE;
+----------+
| COLUMN1 |
+----------+
| 23:59:59 |
| 23:59:59 |
| 23:59:59 |
| 23:59:59 |
+----------+
4 rows in set (0.00 sec)
mysql>
mysql> drop table INCORRECT_DATES;
Query OK, 0 rows affected (0.00 sec)
mysql>
Related examples in the same category