From 2f191db2b11a050e57ebed3bf9eddf7466367784 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Thu, 2 Sep 2004 20:16:01 +0400 Subject: A fix and test case for Bug#4231 "Wrong result with MYSQL_TIME parameters": when unpacking binary time recieved from client, handle the case when length is 0: it means all MYSQL_TIME members are zero. --- sql-common/my_time.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql-common/my_time.c') diff --git a/sql-common/my_time.c b/sql-common/my_time.c index fcfa2efef61..4b5daf53bea 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -716,3 +716,13 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) return (my_time_t) tmp; } /* my_system_gmt_sec */ + + +/* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */ + +void set_zero_time(MYSQL_TIME *tm) +{ + bzero((void*) tm, sizeof(*tm)); + tm->time_type= MYSQL_TIMESTAMP_NONE; +} + -- cgit v1.2.1