summaryrefslogtreecommitdiff
path: root/sql/time.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-10-31 18:27:49 +0200
committerunknown <monty@hundin.mysql.fi>2001-10-31 18:27:49 +0200
commit03f6fdd575f71aacd4b6e782c9df4b929f8222b1 (patch)
tree603547f133fd6eaa7de511aeb171eb8224e0d208 /sql/time.cc
parent3f7cf671a1d735a72e98e89d91a16cce085e6817 (diff)
downloadmariadb-git-03f6fdd575f71aacd4b6e782c9df4b929f8222b1.tar.gz
Portability fixes
Fix for consistent 0000-00-00 date handling Close + open binary logs on flush tables Fix for AVG() in HAVING. BUILD/SETUP.sh: Compile MySQL with -O0 to make debugging easier. Docs/manual.texi: Changelog configure.in: Version change innobase/buf/buf0lru.c: Fix for windows mysql-test/r/func_time.result: Updated tests mysql-test/r/having.result: Updated tests mysql-test/t/func_time.test: Updated tests mysql-test/t/having.test: Updated tests mysys/mf_casecnv.c: Portability fix mysys/mf_qsort.c: Portability fix mysys/my_compress.c: Portability fix mysys/my_tempnam.c: More comments sql/field.cc: Fix for consistent 0000-00-00 date handling sql/item.h: Fix for AVG() in HAVING sql/log.cc: Close + open update logs on flush tables sql/sql_select.cc: More debugging info sql/time.cc: Fix for consistent 0000-00-00 date handling strings/ctype.c: Portability fix strings/strto.c: Portability fix
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))
{