summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2006-04-25 14:34:19 +0500
committerunknown <ramil@mysql.com>2006-04-25 14:34:19 +0500
commit3ca1852cbaac852f778af0e70278cf3a010f4403 (patch)
tree452dbe7efd2b3122541222a471a692048acad12c /sql/item_timefunc.cc
parent4189bfa421672924b9c8a86571717a78bf32de7a (diff)
downloadmariadb-git-3ca1852cbaac852f778af0e70278cf3a010f4403.tar.gz
Fix for bug #18501: Server crashes with monthname().
mysql-test/r/func_time.result: Fix for bug #18501: Server crashes with monthname(). - test case mysql-test/t/func_time.test: Fix for bug #18501: Server crashes with monthname(). - test case sql/item_timefunc.cc: Fix for bug #18501: Server crashes with monthname(). - check null_value as well.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index f3d6858755c..ffd8c79dca8 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -905,9 +905,9 @@ String* Item_func_monthname::val_str(String* str)
{
DBUG_ASSERT(fixed == 1);
const char *month_name;
- uint month=(uint) Item_func_month::val_int();
+ uint month= (uint) val_int();
- if (!month) // This is also true for NULL
+ if (null_value || !month)
{
null_value=1;
return (String*) 0;