diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-04-07 12:59:51 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-04-07 12:59:51 +0300 |
commit | 9d5aac946348b18f2d6d42a9243ff6ea19faefef (patch) | |
tree | 1e22eb33afd40c14cb17603e0ce049608ee20ae5 /sql/item_timefunc.cc | |
parent | 4a6d020e8dda2c76d9902820606cd534324f3df7 (diff) | |
parent | 639c18baddac6b40ce007eba1c3ee4aead0f6af6 (diff) | |
download | mariadb-git-9d5aac946348b18f2d6d42a9243ff6ea19faefef.tar.gz |
merge 5.5->5.5-security
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 5 |
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; |