I have a database where old code likes to insert \'0000-00-00\' in Date and DateTime columns instead of a real date. So I have the following two questions:
delimiter //
CREATE TRIGGER bad_date BEFORE INSERT ON some_table
FOR EACH ROW
BEGIN
IF NEW.the_date='0000-00-00' THEN
SET NEW.the_date= CURDATE();
END IF;
END;//
If updates are a concern, add a separate trigger (BEFORE UPDATE) to do the same thing.