|
|
@ -5922,14 +5922,20 @@ int connect_n_handle_errors(struct st_command *command, |
|
|
|
stay clear of trying to work out which exact user-limit was |
|
|
|
exceeded. |
|
|
|
*/ |
|
|
|
auto my_err= mysql_errno(con); |
|
|
|
if(my_err == 0) |
|
|
|
{ |
|
|
|
/* Workaround client library bug, not indicating connection error. */ |
|
|
|
my_err= CR_SERVER_LOST; |
|
|
|
} |
|
|
|
|
|
|
|
if (((mysql_errno(con) == ER_TOO_MANY_USER_CONNECTIONS) || |
|
|
|
(mysql_errno(con) == ER_USER_LIMIT_REACHED)) && |
|
|
|
if (((my_err == ER_TOO_MANY_USER_CONNECTIONS) || |
|
|
|
(my_err == ER_USER_LIMIT_REACHED)) && |
|
|
|
(failed_attempts++ < opt_max_connect_retries)) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
|
|
|
|
i= match_expected_error(command, mysql_errno(con), mysql_sqlstate(con)); |
|
|
|
i= match_expected_error(command, my_err, mysql_sqlstate(con)); |
|
|
|
|
|
|
|
if (i >= 0) |
|
|
|
goto do_handle_error; /* expected error, handle */ |
|
|
@ -5939,9 +5945,9 @@ int connect_n_handle_errors(struct st_command *command, |
|
|
|
} |
|
|
|
|
|
|
|
do_handle_error: |
|
|
|
var_set_errno(mysql_errno(con)); |
|
|
|
handle_error(command, mysql_errno(con), mysql_error(con), |
|
|
|
mysql_sqlstate(con), ds); |
|
|
|
var_set_errno(my_err); |
|
|
|
handle_error(command, my_err, mysql_error(con), |
|
|
|
mysql_sqlstate(con), ds); |
|
|
|
return 0; /* Not connected */ |
|
|
|
} |
|
|
|
|
|
|
|