diff options
author | unknown <konstantin@mysql.com> | 2004-10-20 16:43:36 +0400 |
---|---|---|
committer | unknown <konstantin@mysql.com> | 2004-10-20 16:43:36 +0400 |
commit | 8fe8912f4c1d01b9bb8c5c1aefe4ac6405a87976 (patch) | |
tree | ad37dd4f3cad10ec79a8a0cbaaab7173c8f8e6d4 /libmysql | |
parent | 9aefc403f9f707edf0f84ce401d32929067aea30 (diff) | |
download | mariadb-git-8fe8912f4c1d01b9bb8c5c1aefe4ac6405a87976.tar.gz |
A fix and test case for bug#6058 "Prepared statements return '0000-00-00'
(date) as empty string": preserve time type (date, time, or datetime) for
zero dates, times, and datetimes.
libmysql/libmysql.c:
A fix for bug#6058 "Prepared statements return '0000-00-00' (date) as empty
string": preserve time type (date, time, or datetime) for zero
dates, times, and datetimes.
tests/client_test.c:
A test case for Bug#6058, the existing tests required some adjustments too.
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index fe008d24e63..249e23a8300 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3221,12 +3221,12 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos) tm->second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; tm->year= tm->month= 0; - tm->time_type= MYSQL_TIMESTAMP_TIME; *pos+= length; } else set_zero_time(tm); + tm->time_type= MYSQL_TIMESTAMP_TIME; } static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) @@ -3251,12 +3251,12 @@ static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) else tm->hour= tm->minute= tm->second= 0; tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; - tm->time_type= MYSQL_TIMESTAMP_DATETIME; *pos+= length; } else set_zero_time(tm); + tm->time_type= MYSQL_TIMESTAMP_DATETIME; } static void read_binary_date(MYSQL_TIME *tm, uchar **pos) @@ -3273,12 +3273,12 @@ static void read_binary_date(MYSQL_TIME *tm, uchar **pos) tm->hour= tm->minute= tm->second= 0; tm->second_part= 0; tm->neg= 0; - tm->time_type= MYSQL_TIMESTAMP_DATE; *pos+= length; } else set_zero_time(tm); + tm->time_type= MYSQL_TIMESTAMP_DATE; } |