summaryrefslogtreecommitdiff
path: root/sql-common
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@station.>2007-12-14 16:30:22 +0300
committerunknown <anozdrin/alik@station.>2007-12-14 16:30:22 +0300
commit541ac204014fb7a051156fb369fadcf77342788c (patch)
tree362dc5c4acd0fff3e86d1b9d4b96ef068d73b341 /sql-common
parenta6eec72e7bcf1ef04dd4569e51fa8845cb192fc1 (diff)
parent35742460f4f252f6d08217997ea2f103b57a5201 (diff)
downloadmariadb-git-541ac204014fb7a051156fb369fadcf77342788c.tar.gz
Merge station.:/mnt/raid/alik/MySQL/devel/5.1
into station.:/mnt/raid/alik/MySQL/devel/5.1-rt client/mysqltest.c: Auto merged include/mysql_com.h: Auto merged libmysqld/emb_qcache.cc: Auto merged libmysqld/emb_qcache.h: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/lib/mtr_report.pl: Auto merged sql/ha_partition.cc: Auto merged sql/item_func.cc: 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/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_select.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged sql/protocol.cc: SCCS merged
Diffstat (limited to 'sql-common')
-rw-r--r--sql-common/my_time.c9
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;