summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-10-31 18:27:49 +0200
committermonty@hundin.mysql.fi <>2001-10-31 18:27:49 +0200
commitd89690e606d38e5b0f1d82117cd26a5264325088 (patch)
tree603547f133fd6eaa7de511aeb171eb8224e0d208 /sql/time.cc
parentc9e4b2aab32a5d27336a4a2595ee20b3c4ff019d (diff)
downloadmariadb-git-d89690e606d38e5b0f1d82117cd26a5264325088.tar.gz
Portability fixes
Fix for consistent 0000-00-00 date handling Close + open binary logs on flush tables Fix for AVG() in HAVING.
Diffstat (limited to 'sql/time.cc')
-rw-r--r--sql/time.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/time.cc b/sql/time.cc
index e0b74fc9d25..1d7e055f682 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -426,7 +426,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");
@@ -452,8 +451,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
@@ -486,7 +484,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))
{