Skip to content

Commit

Permalink
Remove unreachable code section
Browse files Browse the repository at this point in the history
Based on Sergei Golubchik's question about this code section in
#223 (comment),
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:
#223 (comment)

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.
  • Loading branch information
dlenski authored and vuvova committed Dec 21, 2023
1 parent ebcb9ec commit bd87353
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions libmariadb/mariadb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1820,17 +1820,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
mysql->protocol_version= end[0];
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)
{
net->last_errno= CR_VERSION_ERROR;
Expand Down

0 comments on commit bd87353

Please sign in to comment.