You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
few bugs in the tracker support
* ma_multi_malloc wanted uint for size arguments, not size_t * ma_multi_malloc needs NULL pointer at the end. Simple 0 is not always the right size * don't look for tracker info, if the packet does not even has the info_len field
This commit is contained in:
@@ -166,13 +166,13 @@ void *ma_multi_malloc(myf myFlags, ...)
|
||||
{
|
||||
va_list args;
|
||||
char **ptr,*start,*res;
|
||||
uint tot_length,length;
|
||||
size_t tot_length,length;
|
||||
|
||||
va_start(args,myFlags);
|
||||
tot_length=0;
|
||||
while ((ptr=va_arg(args, char **)))
|
||||
{
|
||||
length=va_arg(args,uint);
|
||||
length=va_arg(args, size_t);
|
||||
tot_length+=ALIGN_SIZE(length);
|
||||
}
|
||||
va_end(args);
|
||||
@@ -185,7 +185,7 @@ void *ma_multi_malloc(myf myFlags, ...)
|
||||
while ((ptr=va_arg(args, char **)))
|
||||
{
|
||||
*ptr=res;
|
||||
length=va_arg(args,uint);
|
||||
length=va_arg(args,size_t);
|
||||
res+=ALIGN_SIZE(length);
|
||||
}
|
||||
va_end(args);
|
||||
|
@@ -1929,7 +1929,9 @@ get_info:
|
||||
pos+=2;
|
||||
mysql->warning_count=uint2korr(pos);
|
||||
pos+=2;
|
||||
if (pos < mysql->net.read_pos+length && (item_len= net_field_length(&pos)))
|
||||
if (pos < mysql->net.read_pos+length)
|
||||
{
|
||||
if ((item_len= net_field_length(&pos)))
|
||||
mysql->info=(char*) pos;
|
||||
|
||||
/* check if server supports session tracking */
|
||||
@@ -1970,7 +1972,7 @@ get_info:
|
||||
&session_item, sizeof(LIST),
|
||||
&str, sizeof(MYSQL_LEX_STRING),
|
||||
&data, plen,
|
||||
0))
|
||||
NULL))
|
||||
{
|
||||
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
|
||||
return -1;
|
||||
@@ -2001,7 +2003,7 @@ get_info:
|
||||
&session_item, sizeof(LIST),
|
||||
&str, sizeof(MYSQL_LEX_STRING),
|
||||
&data, plen,
|
||||
0))
|
||||
NULL))
|
||||
{
|
||||
SET_CLIENT_ERROR(mysql, CR_OUT_OF_MEMORY, SQLSTATE_UNKNOWN, 0);
|
||||
return -1;
|
||||
@@ -2040,6 +2042,7 @@ get_info:
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
if (field_count == NULL_LENGTH) /* LOAD DATA LOCAL INFILE */
|
||||
|
Reference in New Issue
Block a user