mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.2'
* PHP-8.2: Fix implicit/explicit port in mysqlnd Closes GH-11990
This commit is contained in:
commit
7e4ca2e8d9
4 changed files with 40 additions and 9 deletions
|
@ -725,19 +725,20 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
|
|||
DBG_RETURN(PASS);
|
||||
}
|
||||
err:
|
||||
DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, transport.s ? transport.s : conn->scheme.s);
|
||||
if (!conn->error_info->error_no) {
|
||||
/* There was an unknown error if the connection failed but we have no error number */
|
||||
char * msg;
|
||||
mnd_sprintf(&msg, 0, "Unknown error while trying to connect via %s", transport.s ? transport.s : conn->scheme.s);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, msg);
|
||||
mnd_sprintf_free(msg);
|
||||
}
|
||||
|
||||
if (transport.s) {
|
||||
mnd_sprintf_free(transport.s);
|
||||
transport.s = NULL;
|
||||
}
|
||||
|
||||
DBG_ERR_FMT("[%u] %.128s (trying to connect via %s)", conn->error_info->error_no, conn->error_info->error, conn->scheme.s);
|
||||
if (!conn->error_info->error_no) {
|
||||
char * msg;
|
||||
mnd_sprintf(&msg, 0, "%s (trying to connect via %s)",conn->error_info->error, conn->scheme.s);
|
||||
SET_CLIENT_ERROR(conn->error_info, CR_CONNECTION_ERROR, UNKNOWN_SQLSTATE, msg);
|
||||
mnd_sprintf_free(msg);
|
||||
}
|
||||
|
||||
conn->m->free_contents(conn);
|
||||
MYSQLND_INC_CONN_STATISTIC(conn->stats, STAT_CONNECT_FAILURE);
|
||||
DBG_RETURN(FAIL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue