diff options
author | Dharman <tekiela246@gmail.com> | 2020-12-21 16:45:14 +0000 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-04 12:31:56 +0100 |
commit | 2f1d32d25c72b9a2f7c2957de3e4150c6d9be2a4 (patch) | |
tree | 44e58b70a3f33b0596e8eda32de6fff98e141e73 /ext/mysqlnd/mysqlnd_commands.c | |
parent | 9b269df6af75364ba7d7f5161bb30b338f148082 (diff) | |
download | php-git-2f1d32d25c72b9a2f7c2957de3e4150c6d9be2a4.tar.gz |
Avoid throwing warnings in mysqlnd
Instead report them as proper client errors.
Closes GH-6530.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_commands.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_commands.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ext/mysqlnd/mysqlnd_commands.c b/ext/mysqlnd/mysqlnd_commands.c index 57ac24b8c5..15beda9a6f 100644 --- a/ext/mysqlnd/mysqlnd_commands.c +++ b/ext/mysqlnd/mysqlnd_commands.c @@ -632,11 +632,11 @@ MYSQLND_METHOD(mysqlnd_command, handshake)(MYSQLND_CONN_DATA * const conn, const SET_CLIENT_ERROR(conn->error_info, greet_packet.error_no, greet_packet.sqlstate, greet_packet.error); goto err; } else if (greet_packet.pre41) { - DBG_ERR_FMT("Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet.server_version); - php_error_docref(NULL, E_WARNING, "Connecting to 3.22, 3.23 & 4.0 " - " is not supported. Server is %-.32s", greet_packet.server_version); - SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, - "Connecting to 3.22, 3.23 & 4.0 servers is not supported"); + char * msg; + mnd_sprintf(&msg, 0, "Connecting to 3.22, 3.23 & 4.0 is not supported. Server is %-.32s", greet_packet.server_version); + DBG_ERR(msg); + SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, msg); + mnd_sprintf_free(msg); goto err; } @@ -646,10 +646,10 @@ MYSQLND_METHOD(mysqlnd_command, handshake)(MYSQLND_CONN_DATA * const conn, const conn->greet_charset = mysqlnd_find_charset_nr(greet_packet.charset_no); if (!conn->greet_charset) { - php_error_docref(NULL, E_WARNING, - "Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet.charset_no); - SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, - "Server sent charset unknown to the client. Please, report to the developers"); + char * msg; + mnd_sprintf(&msg, 0, "Server sent charset (%d) unknown to the client. Please, report to the developers", greet_packet.charset_no); + SET_CLIENT_ERROR(conn->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, msg); + mnd_sprintf_free(msg); goto err; } |