diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-04-07 12:24:10 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-04-07 12:24:10 +0300 |
commit | 2db44e8bb438cc14161aeec24417ee8c04bd98e6 (patch) | |
tree | d3c262164be57c2fe1fb85782cac6633259bf3f3 /sql/item_timefunc.cc | |
parent | a4d073ccc0bf154912ca4b22ee062d920bcd34c9 (diff) | |
parent | 5321b3a57a5191471cba0db85a11e21fb702200a (diff) | |
download | mariadb-git-2db44e8bb438cc14161aeec24417ee8c04bd98e6.tar.gz |
merged mysql-5.1->mysql-5.1-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 74aae94b6f2..797b8cffb92 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -294,8 +294,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) { @@ -3306,6 +3306,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; |