diff options
author | unknown <gluh@eagle.(none)> | 2007-12-13 15:56:04 +0400 |
---|---|---|
committer | unknown <gluh@eagle.(none)> | 2007-12-13 15:56:04 +0400 |
commit | 9a10c20ba912d8b872dfde7fcfc6e551e0da6118 (patch) | |
tree | e37ba43ba6ed4171e2b64ad9dbba79328c95a875 /sql-common | |
parent | 0d5caaa4a1213e7d2d52a27ed41de32f3da0c050 (diff) | |
parent | 76a5b3b976de1ad938ae46525f11992fcb392103 (diff) | |
download | mariadb-git-9a10c20ba912d8b872dfde7fcfc6e551e0da6118.tar.gz |
Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into mysql.com:/home/gluh/MySQL/Merge/5.1-opt
BitKeeper/etc/ignore:
auto-union
client/mysql.cc:
Auto merged
client/mysqltest.c:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/CMakeLists.txt:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/r/archive.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/delayed.result:
Auto merged
mysql-test/r/func_misc.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/merge.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/type_date.result:
Auto merged
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/func_misc.test:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
mysql-test/t/merge.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
mysql-test/t/type_date.test:
Auto merged
mysql-test/t/type_datetime.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
mysys/queues.c:
Auto merged
sql/events.cc:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_cmpfunc.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/protocol.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_partition.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_string.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
storage/myisam/ha_myisam.cc:
Auto merged
storage/myisam/mi_check.c:
Auto merged
storage/myisam/mi_open.c:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/lib/mtr_report.pl:
manual merge
mysql-test/r/myisam.result:
manual merge
mysql-test/r/partition.result:
manual merge
mysql-test/r/user_var.result:
manual merge
mysql-test/t/myisam.test:
manual merge
mysql-test/t/partition.test:
manual merge
mysql-test/t/user_var.test:
manual merge
sql/item.h:
manual merge
sql/item_func.cc:
manual merge
storage/myisammrg/ha_myisammrg.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 48d1b198dfc..543a925681b 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1105,9 +1105,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) @@ -1131,6 +1136,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 */ @@ -1144,7 +1152,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; |