summaryrefslogtreecommitdiff
path: root/sql-common/my_time.c
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-12-04 19:28:38 +0100
committerunknown <msvensson@neptunus.(none)>2006-12-04 19:28:38 +0100
commit2e5a6f9eaabebedcf10f189427fb56577fc9780c (patch)
tree4709d201720e18f147c369d52ae2cde47bec6b24 /sql-common/my_time.c
parent9f1fa169c59c29fa1d9c877efd14ffac5ba87448 (diff)
parent85b1701ab7292eeee4ce4b253909ae68345be43c (diff)
downloadmariadb-git-2e5a6f9eaabebedcf10f189427fb56577fc9780c.tar.gz
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint BitKeeper/etc/ignore: auto-union Docs/Makefile.am: Auto merged Makefile.am: Auto merged client/mysql.cc: Auto merged client/mysqltest.c: Auto merged include/Makefile.am: Auto merged myisam/myisampack.c: Auto merged mysql-test/lib/mtr_io.pl: Auto merged mysql-test/lib/mtr_process.pl: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/view_grant.result: Auto merged mysql-test/t/view_grant.test: Auto merged sql/handler.cc: Auto merged sql/item.cc: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_timefunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/sp.cc: Auto merged sql/sql_base.cc: Auto merged sql-common/my_time.c: Auto merged sql/sql_handler.cc: Auto merged extra/yassl/taocrypt/include/algebra.hpp: Manual merge with import of upstream yaSSL
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r--sql-common/my_time.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c
index e1eedd7ce77..2669f234143 100644
--- a/sql-common/my_time.c
+++ b/sql-common/my_time.c
@@ -431,7 +431,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
goto err;
}
- if (check_date(l_time, not_zero_date, flags, was_cut))
+ if (check_date(l_time, not_zero_date != 0, flags, was_cut))
goto err;
l_time->time_type= (number_of_fields <= 3 ?
@@ -532,15 +532,15 @@ my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
if ((uint) (end-str) > 1 && str != end_of_days &&
my_isdigit(&my_charset_latin1, *str))
{ /* Found days part */
- date[0]= value;
+ date[0]= (ulong) value;
state= 1; /* Assume next is hours */
found_days= 1;
}
else if ((end-str) > 1 && *str == time_separator &&
my_isdigit(&my_charset_latin1, str[1]))
{
- date[0]=0; /* Assume we found hours */
- date[1]=value;
+ date[0]= 0; /* Assume we found hours */
+ date[1]= (ulong) value;
state=2;
found_hours=1;
str++; /* skip ':' */
@@ -549,9 +549,9 @@ my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
{
/* String given as one number; assume HHMMSS format */
date[0]= 0;
- date[1]= value/10000;
- date[2]= value/100 % 100;
- date[3]= value % 100;
+ date[1]= (ulong) (value/10000);
+ date[2]= (ulong) (value/100 % 100);
+ date[3]= (ulong) (value % 100);
state=4;
goto fractional;
}
@@ -561,7 +561,7 @@ my_bool str_to_time(const char *str, uint length, MYSQL_TIME *l_time,
{
for (value=0; str != end && my_isdigit(&my_charset_latin1,*str) ; str++)
value=value*10L + (long) (*str - '0');
- date[state++]=value;
+ date[state++]= (ulong) value;
if (state == 4 || (end-str) < 2 || *str != time_separator ||
!my_isdigit(&my_charset_latin1,str[1]))
break;
@@ -596,7 +596,7 @@ fractional:
value*= (long) log_10_int[field_length];
else if (field_length < 0)
*warning|= MYSQL_TIME_WARN_TRUNCATED;
- date[4]=value;
+ date[4]= (ulong) value;
}
else
date[4]=0;