diff options
Diffstat (limited to 'ext/mysqlnd/mysqlnd_commands.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_commands.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/ext/mysqlnd/mysqlnd_commands.c b/ext/mysqlnd/mysqlnd_commands.c index 953c3a2fcd..c5ca7a763e 100644 --- a/ext/mysqlnd/mysqlnd_commands.c +++ b/ext/mysqlnd/mysqlnd_commands.c @@ -112,11 +112,6 @@ MYSQLND_METHOD(mysqlnd_command, init_db)(MYSQLND_CONN_DATA * const conn, const M } conn->connect_or_select_db.s = mnd_pestrndup(db.s, db.l, conn->persistent); conn->connect_or_select_db.l = db.l; - if (!conn->connect_or_select_db.s) { - /* OOM */ - SET_OOM_ERROR(conn->error_info); - ret = FAIL; - } } DBG_RETURN(ret); @@ -192,7 +187,7 @@ MYSQLND_METHOD(mysqlnd_command, statistics)(MYSQLND_CONN_DATA * const conn, zend /* {{{ mysqlnd_command::process_kill */ static enum_func_status -MYSQLND_METHOD(mysqlnd_command, process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const zend_bool read_response) +MYSQLND_METHOD(mysqlnd_command, process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const bool read_response) { const func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command; const func_mysqlnd_protocol_payload_decoder_factory__send_command_handle_response send_command_handle_response = conn->payload_decoder_factory->m.send_command_handle_response; @@ -338,7 +333,7 @@ MYSQLND_METHOD(mysqlnd_command, query)(MYSQLND_CONN_DATA * const conn, MYSQLND_C /* {{{ mysqlnd_command::change_user */ static enum_func_status -MYSQLND_METHOD(mysqlnd_command, change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const zend_bool silent) +MYSQLND_METHOD(mysqlnd_command, change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const bool silent) { const func_mysqlnd_protocol_payload_decoder_factory__send_command send_command = conn->payload_decoder_factory->m.send_command; enum_func_status ret = FAIL; @@ -563,7 +558,7 @@ MYSQLND_METHOD(mysqlnd_command, enable_ssl)(MYSQLND_CONN_DATA * const conn, cons #ifdef MYSQLND_SSL_SUPPORTED if (client_capabilities & CLIENT_SSL) { - const zend_bool server_has_ssl = (server_capabilities & CLIENT_SSL)? TRUE:FALSE; + const bool server_has_ssl = (server_capabilities & CLIENT_SSL)? TRUE:FALSE; if (server_has_ssl == FALSE) { goto close_conn; } else { @@ -637,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; } @@ -651,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; } |