mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Make PACKET_TOO_LARGE error handling safer in client
This commit is contained in:
@ -460,13 +460,12 @@ 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;
|
||||||
@ -474,7 +473,6 @@ simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
|||||||
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 ?
|
||||||
|
Reference in New Issue
Block a user