summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-04-07 12:59:51 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-04-07 12:59:51 +0300
commit9d5aac946348b18f2d6d42a9243ff6ea19faefef (patch)
tree1e22eb33afd40c14cb17603e0ce049608ee20ae5 /sql/item_timefunc.cc
parent4a6d020e8dda2c76d9902820606cd534324f3df7 (diff)
parent639c18baddac6b40ce007eba1c3ee4aead0f6af6 (diff)
downloadmariadb-git-9d5aac946348b18f2d6d42a9243ff6ea19faefef.tar.gz
merge 5.5->5.5-security
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index d5bde222d4c..19e7b3f52ef 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -315,8 +315,8 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
for (; ptr != end && val != val_end; ptr++)
{
/* Skip pre-space between each argument */
- while (val != val_end && my_isspace(cs, *val))
- val++;
+ if ((val+= cs->cset->scan(cs, val, val_end, MY_SEQ_SPACES)) >= val_end)
+ break;
if (*ptr == '%' && ptr+1 != end)
{
@@ -3418,6 +3418,7 @@ void Item_func_str_to_date::fix_length_and_dec()
{
maybe_null= 1;
decimals=0;
+ cached_format_type= DATE_TIME;
cached_field_type= MYSQL_TYPE_DATETIME;
max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
cached_timestamp_type= MYSQL_TIMESTAMP_NONE;