From 1019b95877bd1a8f581e58a9f2d52ec52d23e5b7 Mon Sep 17 00:00:00 2001
From: Tor Didriksen <tor.didriksen@oracle.com>
Date: Thu, 28 Apr 2011 09:03:56 +0200
Subject: Bug#12340997 - DATE_ADD/DATE_SUB WITH INTERVAL CRASHES IN
 GET_INTERVAL_VALUE()

get_interval_value() was trying to parse the input string,
looking for leading '-' while skipping whitespace.
The macro my_isspace() does not work for utf16 character set,
since my_charset_utf16_general_ci.ctype == NULL.

Solution: convert input to ASCII before parsing.
---
 sql/item_timefunc.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'sql/item_timefunc.cc')

diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 19e7b3f52ef..36b85f2411f 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1430,7 +1430,7 @@ bool get_interval_value(Item *args,interval_type int_type,
   else
   {
     String *res;
-    if (!(res=args->val_str(str_value)))
+    if (!(res= args->val_str_ascii(str_value)))
       return (1);
 
     /* record negative intervalls in interval->neg */
-- 
cgit v1.2.1