You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
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.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user