summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_timefunc.h')
-rw-r--r--sql/item_timefunc.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index e930a24d2b0..0852629b1ae 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -107,8 +107,11 @@ public:
{ DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
String *val_str(String *str)
{
- str->set(val_int(), &my_charset_bin);
- return null_value ? 0 : str;
+ longlong nr= val_int();
+ if (null_value)
+ return 0;
+ str->set(nr, &my_charset_bin);
+ return str;
}
const char *func_name() const { return "month"; }
enum Item_result result_type () const { return INT_RESULT; }