diff options
author | unknown <gluh@eagle.(none)> | 2007-12-13 14:52:49 +0400 |
---|---|---|
committer | unknown <gluh@eagle.(none)> | 2007-12-13 14:52:49 +0400 |
commit | 33f82b17893edc7d39e523f3cf03858338b6a4a0 (patch) | |
tree | b870e5e7b713672711344eb2e5b585f3e2c48375 /sql-common | |
parent | 0ced2a4d19839417ca6a6d6c8cc9c5cba259ef76 (diff) | |
parent | 196f0c751f9a36b34f0dd5e15df4a9fcd51c0b81 (diff) | |
download | mariadb-git-33f82b17893edc7d39e523f3cf03858338b6a4a0.tar.gz |
Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into mysql.com:/home/gluh/MySQL/Merge/5.0-opt
client/mysql.cc:
Auto merged
client/mysqltest.c:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
myisam/mi_check.c:
Auto merged
mysql-test/r/delayed.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/myisam.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/myisam.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/field.cc:
Auto merged
sql/ha_myisam.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/func_misc.result:
manual merge
mysql-test/r/innodb_mysql.result:
manual merge
mysql-test/t/func_misc.test:
manual merge
mysql-test/t/innodb_mysql.test:
manual merge
sql/sql_insert.cc:
manual merge
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/my_time.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 453c7b73008..ecc5aaf8af2 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1108,9 +1108,14 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, long part1,part2; *was_cut= 0; + bzero((char*) time_res, sizeof(*time_res)); + time_res->time_type=MYSQL_TIMESTAMP_DATE; if (nr == LL(0) || nr >= LL(10000101000000)) + { + time_res->time_type=MYSQL_TIMESTAMP_DATETIME; goto ok; + } if (nr < 101) goto err; if (nr <= (YY_PART_YEAR-1)*10000L+1231L) @@ -1134,6 +1139,9 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, } if (nr < 101000000L) goto err; + + time_res->time_type=MYSQL_TIMESTAMP_DATETIME; + if (nr <= (YY_PART_YEAR-1)*LL(10000000000)+LL(1231235959)) { nr= nr+LL(20000000000000); /* YYMMDDHHMMSS, 2000-2069 */ @@ -1147,7 +1155,6 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, ok: part1=(long) (nr/LL(1000000)); part2=(long) (nr - (longlong) part1*LL(1000000)); - bzero((char*) time_res, sizeof(*time_res)); time_res->year= (int) (part1/10000L); part1%=10000L; time_res->month= (int) part1 / 100; time_res->day= (int) part1 % 100; |