1
0
mirror of https://github.com/mariadb-corporation/mariadb-connector-c.git synced 2025-08-07 02:42:49 +03:00

Fix for CONC-703:

If connect failed and no error was set (apparently this happens
sometimes on Mac) we now set error to CR_SERVER_LOST.
This commit is contained in:
Georg Richter
2024-11-27 07:48:27 +01:00
parent 662a966056
commit bdc66d6b8f

View File

@@ -2040,6 +2040,12 @@ error:
if (!(client_flag & CLIENT_REMEMBER_OPTIONS) &&
!(IS_MYSQL_ASYNC(mysql)))
mysql_close_options(mysql);
/* CONC-703: If no error was set, we set CR_SERVER_LOST by default */
if (!mysql_errno(mysql))
my_set_error(mysql, CR_SERVER_LOST, SQLSTATE_UNKNOWN,
"Can't connect to server (%d).",
errno);
return(0);
}