This script crashes mysqld:
drop table if exists t1;
create table t1 (a datetime(4) not null);
insert into t1 values ('2001-01-01 00:00:00'),('2000-00-00 00:00:00');
select unix_timestamp(a) from t1 order by 1;
The problem seems to be in a missing call for:
which was added in 5.5.
Fixed. Pushed into 5.3.13 and 5.5.32.