Skip to content
Permalink
Browse files

Fix for MDEV-18721 (Host option in configuration file is ignored.)

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 31ae1278aa4ba2e4832c279d71f3a06ef80ffbea
Showing with 5 additions and 5 deletions.
  1. +5 −5 libmariadb/mariadb_lib.c
@@ -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);
@@ -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)
{

0 comments on commit 31ae127

Please sign in to comment.
You can’t perform that action at this time.