diff options
author | monty@hundin.mysql.fi <> | 2001-11-04 16:14:09 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-11-04 16:14:09 +0200 |
commit | fd0780493d9f91c1b4e8a0ff80fc670d5cf3b19a (patch) | |
tree | 689c9d0271e23431f1ab0ac09e1af4d68a58ca76 /sql/time.cc | |
parent | 67951fdeb4195d6fcefeba6aab811b6c5e585178 (diff) | |
parent | 65d4c846d83467270e56537b2cd0f44fc37ef9be (diff) | |
download | mariadb-git-fd0780493d9f91c1b4e8a0ff80fc670d5cf3b19a.tar.gz |
merge with 3.23.44
Diffstat (limited to 'sql/time.cc')
-rw-r--r-- | sql/time.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/time.cc b/sql/time.cc index 440cba457f4..e4565bdeea7 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -429,7 +429,6 @@ timestamp_type str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) { uint field_length,year_length,digits,i,number_of_fields,date[7]; - bool date_used=0; const char *pos; const char *end=str+length; DBUG_ENTER("str_to_TIME"); @@ -455,8 +454,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) tmp_value=tmp_value*10 + (uint) (uchar) (*str - '0'); str++; } - if ((date[i]=tmp_value)) - date_used=1; // Found something + date[i]=tmp_value; if (i == 2 && str != end && *str == 'T') str++; // ISO8601: CCYYMMDDThhmmss else if ( i != 5 ) // Skip inter-field delimiters @@ -489,7 +487,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) number_of_fields=i; while (i < 6) date[i++]=0; - if (number_of_fields < 3 || !date_used || date[1] > 12 || + if (number_of_fields < 3 || date[1] > 12 || date[2] > 31 || date[3] > 23 || date[4] > 59 || date[5] > 59 || !fuzzy_date && (date[1] == 0 || date[2] == 0)) { |