1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00
embedded&client library
some fixes: zero at the end of the data added
mysql_list_fields became 'virtual'
This commit is contained in:
hf@deer.(none)
2003-09-11 09:46:31 +05:00
parent 4f3474922b
commit f434b329f5
7 changed files with 52 additions and 8 deletions

View File

@ -487,11 +487,12 @@ bool Protocol_simple::store_null()
bool Protocol::net_store_data(const char *from, uint length)
{
char *field_buf;
if (!(field_buf=alloc_root(alloc, length + sizeof(uint))))
if (!(field_buf=alloc_root(alloc, length + sizeof(uint) + 1)))
return true;
*(uint *)field_buf= length;
*next_field= field_buf + sizeof(uint);
memcpy(*next_field, from, length);
(*next_field)[length]= 0;
if (next_mysql_field->max_length < length)
next_mysql_field->max_length=length;
++next_field;