1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

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.


include/my_time.h:
  Declaration for set_zero_time: a tiny piece of code, which I
  see no reason to not reuse.
libmysql/libmysql.c:
  set_zero_time implementation is now shared between client and
  server.
sql-common/my_time.c:
  set_zero_time implementation added.
sql/sql_prepare.cc:
  A fix 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.
tests/client_test.c:
  Test case for bug#4231 "Wrong result with MYSQL_TIME parameters"
This commit is contained in:
unknown
2004-09-02 20:16:01 +04:00
parent 3c3db07321
commit 0c58737ad6
5 changed files with 116 additions and 27 deletions

View File

@ -3167,13 +3167,6 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
Fetch and conversion of result set rows (binary protocol).
*********************************************************************/
static void set_zero_time(MYSQL_TIME *tm)
{
bzero((void *)tm, sizeof(*tm));
tm->time_type= MYSQL_TIMESTAMP_NONE;
}
/*
Read date, (time, datetime) value from network buffer and store it
in MYSQL_TIME structure.