Commit 9aa49681 authored by monty@mashka.mysql.fi's avatar monty@mashka.mysql.fi

Make PACKET_TOO_LARGE error handling safer in client

parent 2162408b
...@@ -460,21 +460,19 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg, ...@@ -460,21 +460,19 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
{ {
net->last_errno=CR_NET_PACKET_TOO_LARGE; net->last_errno=CR_NET_PACKET_TOO_LARGE;
strmov(net->last_error,ER(net->last_errno)); strmov(net->last_error,ER(net->last_errno));
return(packet_error); goto end;
} }
else
{
end_server(mysql); end_server(mysql);
if (mysql_reconnect(mysql) || if (mysql_reconnect(mysql))
net_write_command(net,(uchar) command,arg, goto end;
if (net_write_command(net,(uchar) command,arg,
length ? length : (ulong) strlen(arg))) length ? length : (ulong) strlen(arg)))
{ {
net->last_errno=CR_SERVER_GONE_ERROR; net->last_errno= CR_SERVER_GONE_ERROR;
strmov(net->last_error,ER(net->last_errno)); strmov(net->last_error,ER(net->last_errno));
goto end; goto end;
} }
} }
}
result=0; result=0;
if (!skipp_check) if (!skipp_check)
result= ((mysql->packet_length=net_safe_read(mysql)) == packet_error ? result= ((mysql->packet_length=net_safe_read(mysql)) == packet_error ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment