summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-11-09 16:17:50 +0400
committerunknown <ramil/ram@mysql.com/myoffice.izhnet.ru>2006-11-09 16:17:50 +0400
commit69d8bfe2319f313ab31f92a450890a870b630fe7 (patch)
tree54338f4d7c09cc993c7df976103b54a61c41d7ce /mysql-test/t
parent870b2e0a2b4a66c6b4b4f15792d72a7415190650 (diff)
downloadmariadb-git-69d8bfe2319f313ab31f92a450890a870b630fe7.tar.gz
Fix for bug #23653: Crash if last_day('0000-00-00')
As get_arg0_date() in the Item_func_last_day::get_date() returns 0000-00-00 date sometimes, we have to check ltime->month for 0 after the call. mysql-test/r/func_time.result: Fix for bug #23653: Crash if last_day('0000-00-00') - test result. mysql-test/t/func_time.test: Fix for bug #23653: Crash if last_day('0000-00-00') - test case. sql/item_timefunc.cc: Fix for bug #23653: Crash if last_day('0000-00-00') - return error if month is 0.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_time.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 066a059483c..a9b6be0cc72 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -446,4 +446,10 @@ union
union
(select time_format(timediff(now(), DATE_SUB(now(),INTERVAL 5 HOUR)),'%k') As H);
+#
+# Bug #23653: crash if last_day('0000-00-00')
+#
+
+select last_day('0000-00-00');
+
--echo End of 4.1 tests