Skip to content

Commit

Permalink
Fix for MDEV-18721 (Host option in configuration file is ignored.)
Browse files Browse the repository at this point in the history
We need to check the passed host variable after the configuration file was read.
Thanks to Peter Penchev and Corey Hickey for providing patches.
  • Loading branch information
9EOR9 committed Feb 24, 2019
1 parent 0acf529 commit 31ae127
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libmariadb/mariadb_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1215,11 +1215,6 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
if (!mysql->methods)
mysql->methods= &MARIADB_DEFAULT_METHODS;

if (!host || !host[0])
host = mysql->options.host;

ma_set_connect_attrs(mysql, host);

if (net->pvio) /* check if we are already connected */
{
SET_CLIENT_ERROR(mysql, CR_ALREADY_CONNECTED, SQLSTATE_UNKNOWN, 0);
Expand All @@ -1238,6 +1233,11 @@ MYSQL *mthd_my_real_connect(MYSQL *mysql, const char *host, const char *user,
mysql->options.my_cnf_file=mysql->options.my_cnf_group=0;
}

if (!host || !host[0])
host = mysql->options.host;

ma_set_connect_attrs(mysql, host);

#ifndef WIN32
if (mysql->options.protocol > MYSQL_PROTOCOL_SOCKET)
{
Expand Down

0 comments on commit 31ae127

Please sign in to comment.