I have two questions:
- Why does mysql is not able to notify error when inserting wrong date
0000-00-00when in the table definition its set to not null..?
example Schema: here
Now if change the duedate to 1970-01-01 it shows error
Incorrect date value
0000-00-00for the column duedate at row1
update my_list set duedate = '1970-01-01' where duedate = '0000-00-00';
I tried to modify the column but it still shows the same error
ALTER TABLE `my_list` modify `duedate` date NULL;
ALTER TABLE `my_list` MODIFY `duedate` DATE NOT NULL DEFAULT '1970-01-01';
- How do I change the duedate to
1970-01-01for0000-00-00;
I got the database from the client so unfortunately work on my.cnf file.
More info:
MYSQL version: 5.5
EDIT: This is working
update my_list set duedate = '1970-01-01' where id = 16;
but not
update my_list set duedate = '1970-01-01' where duedate = '0000-00-00';