MySQL in RDS is not throwing error for invalid datetime?

68 Views Asked by At

I want MySQL should throw an error for Invalid datetime format, But it is not happening in my case.

INSERT INTO `users` (`userId`,`name`,`dob`) VALUES (DEFAULT, "Cane", "3000-60-99");

While executing above query below log will come out.

1265 Data truncated for column 'dob' at row 1

and the DB will contain the value :

5, cane, 0000-00-00 00:00:00

Describe users :

Field  | Type        | Null | Key |  Extra
-----------------------------------------------
userid | int(11)     | NO   | PRI |  auto_increment
name   | varchar(255)| YES  |     |
dob    | datetime    | YES  |     |
0

There are 0 best solutions below