summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-03-09 11:59:47 +0100
committerSergei Golubchik <sergii@pisem.net>2011-03-09 11:59:47 +0100
commit3c6ff364ca31c9b8bc14f5fe583cd60ee5516bfd (patch)
tree9eacec19253684370625e03db243663f2b38d30d /mysql-test
parenteeb7f5129b7e404b1612f1a39c243f3678c89117 (diff)
downloadmariadb-git-3c6ff364ca31c9b8bc14f5fe583cd60ee5516bfd.tar.gz
lp:731815 Crash/valgrind warning Item::send with 5.1-micro
Two problems: * Item_func_convert_tz() did not tell args[0] that it needs TIME_NO_ZERO_IN_DATE result * Item_func_timediff did not respect fuzzy_date limitations, truncated seconds when casting to signed long, resulting in invalid time value (hours, seconds = (uint)-1).
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_time.result8
-rw-r--r--mysql-test/t/func_time.test6
2 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 781d2bf3e97..b5c35d40a0f 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -1468,3 +1468,11 @@ Warnings:
Warning 1292 Incorrect datetime value: '0'
Warning 1292 Incorrect datetime value: '0'
drop table t1;
+select timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime));
+timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime))
+-838:59:59.999999
+Warnings:
+Warning 1292 Truncated incorrect time value: '-596523:14:07'
+select convert_tz(timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime)), 'UTC', 'Europe/Moscow');
+convert_tz(timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime)), 'UTC', 'Europe/Moscow')
+NULL
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 5d8d4427ab0..db06a462183 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -910,3 +910,9 @@ select last_day(f2) from t1;
select last_day(f2) from t1 where last_day(f2) is null;
select * from t1 order by last_day (f2);
drop table t1;
+
+#
+# lp:731815 Crash/valgrind warning Item::send with 5.1-micro
+#
+select timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime));
+select convert_tz(timediff('0000-00-00 00:00:00', cast('2008-03-26 07:09:06' as datetime)), 'UTC', 'Europe/Moscow');