1
0
mirror of https://github.com/MariaDB/server.git synced 2025-06-12 01:53:02 +03:00

bug #20152: mysql_stmt_execute() overwrites parameter buffers

When using a parameter bind MYSQL_TYPE_DATE in a prepared statement,
the time part of the MYSQL_TIME buffer was written to zero in
mysql_stmt_execute(). The param_store_date() function in libmysql.c
worked directly on the provided buffer.
Changed to use a copy of the buffer.
This commit is contained in:
kroki@mysql.com
2006-06-30 12:52:05 +04:00
parent 366339f4ed
commit 79ca4c1d55
2 changed files with 56 additions and 4 deletions

View File

@ -2409,10 +2409,9 @@ static void net_store_datetime(NET *net, MYSQL_TIME *tm)
static void store_param_date(NET *net, MYSQL_BIND *param)
{
MYSQL_TIME *tm= (MYSQL_TIME *) param->buffer;
tm->hour= tm->minute= tm->second= 0;
tm->second_part= 0;
net_store_datetime(net, tm);
MYSQL_TIME tm= *((MYSQL_TIME *) param->buffer);
tm.hour= tm.minute= tm.second= tm.second_part= 0;
net_store_datetime(net, &tm);
}
static void store_param_datetime(NET *net, MYSQL_BIND *param)