cast(timestamp() AS time returns NULL for 0000-00-00 00:00:00 in 5.1-micro

Reported by Philip Stoev on 2011-03-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Maria
Fix Released
Critical
Sergei

Bug Description

In 5.1-micro, the following expression

cast(timestamp(f1) AS time)

returns NULL if f1 = 0000-00-00 00:00:00 . In mysql-5.1 , it returns 00:00:00, which is the more intuitive result

test case:

drop table t1;
create table t1 (f1 datetime);
insert into t1 values ('0000-00-00 00:00:00');
select cast(timestamp(f1) AS time) from t1;

Related branches

Changed in maria:
milestone: none → 5.3
assignee: nobody → Sergei (sergii)
Sergei (sergii) on 2011-03-19
Changed in maria:
importance: Undecided → Critical
status: New → Fix Committed
Sergei (sergii) on 2011-10-28
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers