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 | 8fbd9e4ca1d6886ea059b0a913d80c5dc90c3fb2 (patch) | |
tree | d3c262164be57c2fe1fb85782cac6633259bf3f3 /sql/item_timefunc.cc | |
parent | 9ef854a4479522ebe3a5cbfc9559b8c8e0efaa5c (diff) | |
parent | 19332ed7b9011e4692d27ff59b912eec385dfc33 (diff) | |
download | mariadb-git-8fbd9e4ca1d6886ea059b0a913d80c5dc90c3fb2.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; |