Skip to content

Commit

Permalink
10.2 protocol fixes: exclude trailing 0 when checking for RPL_HACK in
Browse files Browse the repository at this point in the history
version number.
Shift extended client flags up instead of down
  • Loading branch information
9EOR9 committed Nov 20, 2015
1 parent 5fca341 commit 955bb8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmariadb/libmariadb.c
Expand Up @@ -1534,7 +1534,7 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
mysql->port=port;
client_flag|=mysql->options.client_flag;

if (strncmp(end, MA_RPL_VERSION_HACK, sizeof(MA_RPL_VERSION_HACK)) == 0)
if (strncmp(end, MA_RPL_VERSION_HACK, sizeof(MA_RPL_VERSION_HACK) - 1) == 0)
{
if (!(mysql->server_version= my_strdup(end + sizeof(MA_RPL_VERSION_HACK), 0)))
{
Expand Down
4 changes: 2 additions & 2 deletions plugins/auth/my_auth.c
Expand Up @@ -218,10 +218,10 @@ static int send_client_reply_packet(MCPVIO_EXT *mpvio,
int4store(buff+4, net->max_packet_size);
buff[8]= (char) mysql->charset->nr;
bzero(buff + 9, 32-9);
if (!(mysql->server_capabilities & MARIADB_CLIENT_EXTENDED_PROTOCOL))
if (mysql->server_capabilities & MARIADB_CLIENT_EXTENDED_PROTOCOL)
{
mysql->client_flag |= MARIADB_CLIENT_SUPPORTED_FLAGS;
int4store(buff + 28, mysql->client_flag << 32);
int4store(buff + 28, mysql->client_flag >> 32);
}
end= buff+32;
}
Expand Down

0 comments on commit 955bb8d

Please sign in to comment.