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

Bug #738091 reported by Philip Stoev on 2011-03-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Sergei Golubchik

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)
Changed in maria:
importance: Undecided → Critical
status: New → Fix Committed
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