1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Remove unreachable code section

Based on Sergei Golubchik's question about this code section in
https://github.com/mariadb-corporation/mariadb-connector-c/pull/223#issuecomment-1773728383,
eventually culminating in the conclusion that it's literally impossible to
reach this code section based on the types and signedess of the variables
involved:
https://github.com/mariadb-corporation/mariadb-connector-c/pull/223#issuecomment-1854720364

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
This commit is contained in:
Daniel Lenski
2023-12-05 15:55:24 -08:00
committed by Sergei Golubchik
parent ebcb9eca29
commit bd87353512

View File

@@ -1820,17 +1820,6 @@ restart:
mysql->protocol_version= end[0]; mysql->protocol_version= end[0];
end++; end++;
/* Check if server sends an error */
if (mysql->protocol_version == 0XFF)
{
net_get_error(end, pkt_length - 1, net->last_error, sizeof(net->last_error),
&net->last_errno, net->sqlstate);
/* fix for bug #26426 */
if (net->last_errno == 1040)
memcpy(net->sqlstate, "08004", SQLSTATE_LENGTH);
goto error;
}
if (mysql->protocol_version < PROTOCOL_VERSION) if (mysql->protocol_version < PROTOCOL_VERSION)
{ {
net->last_errno= CR_VERSION_ERROR; net->last_errno= CR_VERSION_ERROR;