summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-03-19 15:19:05 +0100
committerSergei Golubchik <sergii@pisem.net>2011-03-19 15:19:05 +0100
commit299b29b27300f7c4c6600deaf077a98e322fdc86 (patch)
tree4e30a023265305872a37c50c511f9834bf3bf5de /mysql-test
parenta67bf98f02237e39a475bedc362e8fc28dbe44fb (diff)
downloadmariadb-git-299b29b27300f7c4c6600deaf077a98e322fdc86.tar.gz
lp:738091 cast(timestamp() AS time returns NULL for 0000-00-00 00:00:00 in 5.1-micro
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_time.result6
-rw-r--r--mysql-test/t/func_time.test9
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 9e04078f1ee..0b20b7e9b61 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1539,3 +1539,9 @@ NULL
select timestamp(greatest('2002-08-20', '0000-00-00 00:00:00'));
timestamp(greatest('2002-08-20', '0000-00-00 00:00:00'))
2002-08-20 00:00:00
+create table t1 (f1 datetime);
+insert into t1 values ('0000-00-00 00:00:00');
+select cast(f1 AS time) from t1;
+cast(f1 AS time)
+00:00:00
+drop table t1;
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 70451e98763..cf725893505 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -977,3 +977,12 @@ select day(coalesce(null));
# lp:738067 Crash in get_datetime_value() in 5.1-micro
#
select timestamp(greatest('2002-08-20', '0000-00-00 00:00:00'));
+
+#
+# lp:738091 cast(timestamp() AS time returns NULL for 0000-00-00 00:00:00 in 5.1-micro
+#
+create table t1 (f1 datetime);
+insert into t1 values ('0000-00-00 00:00:00');
+select cast(f1 AS time) from t1;
+drop table t1;
+