Skip to content

Remove mysqlnd_shutdown() #10355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ PHP 8.3 INTERNALS UPGRADE NOTES
length at each call. The key_suffix parameter was dropped as it was a
constant value and depended on the key_prefix parameter to not be NULL.

c. ext/mysqlnd
- The function mysqlnd_shutdown and its corresponding internal methods
mysqlnd_command::shutdown & mysqlnd_conn_data::shutdown have been removed.
These functions are deprecated by MySQL in favour of SHUTDOWN SQL statement.

========================
4. OpCode changes
========================
Expand Down
1 change: 0 additions & 1 deletion ext/mysqlnd/mysqlnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ PHPAPI void mysqlnd_local_infile_default(MYSQLND_CONN_DATA * conn);
#define mysqlnd_ping(conn) ((conn)->data)->m->ping((conn)->data)
#define mysqlnd_kill(conn, pid) ((conn)->data)->m->kill_connection((conn)->data, (pid))
#define mysqlnd_refresh(conn, options) ((conn)->data)->m->refresh_server((conn)->data, (options))
#define mysqlnd_shutdown(conn, level) ((conn)->data)->m->shutdown_server((conn)->data, (level))
#define mysqlnd_set_character_set(conn, cs) ((conn)->data)->m->set_charset((conn)->data, (cs))
#define mysqlnd_stat(conn, msg) ((conn)->data)->m->get_server_statistics(((conn)->data), (msg))
#define mysqlnd_options(conn, opt, value) ((conn)->data)->m->set_client_option((conn)->data, (opt), (value))
Expand Down
30 changes: 0 additions & 30 deletions ext/mysqlnd/mysqlnd_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,35 +250,6 @@ MYSQLND_METHOD(mysqlnd_command, refresh)(MYSQLND_CONN_DATA * const conn, const u
/* }}} */


/* {{{ mysqlnd_command::shutdown */
static enum_func_status
MYSQLND_METHOD(mysqlnd_command, shutdown)(MYSQLND_CONN_DATA * const conn, const uint8_t level)
{
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;
zend_uchar bits[1];
enum_func_status ret = FAIL;

DBG_ENTER("mysqlnd_command::shutdown");
int1store(bits, level);

ret = send_command(conn->payload_decoder_factory, COM_SHUTDOWN, bits, 1, FALSE,
&conn->state,
conn->error_info,
conn->upsert_status,
conn->stats,
conn->m->send_close,
conn);
if (PASS == ret) {
ret = send_command_handle_response(conn->payload_decoder_factory, PROT_OK_PACKET, FALSE, COM_SHUTDOWN, TRUE,
conn->error_info, conn->upsert_status, &conn->last_message);
}

DBG_RETURN(ret);
}
/* }}} */


/* {{{ mysqlnd_command::quit */
static enum_func_status
MYSQLND_METHOD(mysqlnd_command, quit)(MYSQLND_CONN_DATA * const conn)
Expand Down Expand Up @@ -680,7 +651,6 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_command)
MYSQLND_METHOD(mysqlnd_command, statistics),
MYSQLND_METHOD(mysqlnd_command, process_kill),
MYSQLND_METHOD(mysqlnd_command, refresh),
MYSQLND_METHOD(mysqlnd_command, shutdown),
MYSQLND_METHOD(mysqlnd_command, quit),
MYSQLND_METHOD(mysqlnd_command, query),
MYSQLND_METHOD(mysqlnd_command, change_user),
Expand Down
14 changes: 1 addition & 13 deletions ext/mysqlnd/mysqlnd_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn)
mysqlnd_set_persistent_string(&conn->unix_socket, NULL, 0, pers);
DBG_INF_FMT("scheme=%s", conn->scheme.s);
mysqlnd_set_persistent_string(&conn->scheme, NULL, 0, pers);

if (conn->server_version) {
mnd_pefree(conn->server_version, pers);
conn->server_version = NULL;
Expand Down Expand Up @@ -1045,17 +1045,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8
/* }}} */


/* {{{ mysqlnd_conn_data::shutdown */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level)
{
DBG_ENTER("mysqlnd_conn_data::shutdown");
DBG_INF_FMT("conn=%" PRIu64 " level=%u", conn->thread_id, level);
DBG_RETURN(conn->command->shutdown(conn, level));
}
/* }}} */


/* {{{ mysqlnd_send_close */
static enum_func_status
MYSQLND_METHOD(mysqlnd_conn_data, send_close)(MYSQLND_CONN_DATA * const conn)
Expand Down Expand Up @@ -1954,7 +1943,6 @@ MYSQLND_CLASS_METHODS_START(mysqlnd_conn_data)

MYSQLND_METHOD(mysqlnd_conn_data, stmt_init),

MYSQLND_METHOD(mysqlnd_conn_data, shutdown),
MYSQLND_METHOD(mysqlnd_conn_data, refresh),

MYSQLND_METHOD(mysqlnd_conn_data, ping),
Expand Down
3 changes: 0 additions & 3 deletions ext/mysqlnd/mysqlnd_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ typedef enum_func_status (*func_mysqlnd_execute_com_ping)(MYSQLND_CONN_DATA * co
typedef enum_func_status (*func_mysqlnd_execute_com_statistics)(MYSQLND_CONN_DATA * const conn, zend_string ** message);
typedef enum_func_status (*func_mysqlnd_execute_com_process_kill)(MYSQLND_CONN_DATA * const conn, const unsigned int process_id, const bool read_response);
typedef enum_func_status (*func_mysqlnd_execute_com_refresh)(MYSQLND_CONN_DATA * const conn, const uint8_t options);
typedef enum_func_status (*func_mysqlnd_execute_com_shutdown)(MYSQLND_CONN_DATA * const conn, const uint8_t level);
typedef enum_func_status (*func_mysqlnd_execute_com_quit)(MYSQLND_CONN_DATA * const conn);
typedef enum_func_status (*func_mysqlnd_execute_com_query)(MYSQLND_CONN_DATA * const conn, MYSQLND_CSTRING query);
typedef enum_func_status (*func_mysqlnd_execute_com_change_user)(MYSQLND_CONN_DATA * const conn, const MYSQLND_CSTRING payload, const bool silent);
Expand All @@ -335,7 +334,6 @@ MYSQLND_CLASS_METHODS_TYPE(mysqlnd_command)
func_mysqlnd_execute_com_statistics statistics;
func_mysqlnd_execute_com_process_kill process_kill;
func_mysqlnd_execute_com_refresh refresh;
func_mysqlnd_execute_com_shutdown shutdown;
func_mysqlnd_execute_com_quit quit;
func_mysqlnd_execute_com_query query;
func_mysqlnd_execute_com_change_user change_user;
Expand Down Expand Up @@ -533,7 +531,6 @@ MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data)

func_mysqlnd_conn_data__stmt_init stmt_init;

func_mysqlnd_conn_data__shutdown_server shutdown_server;
func_mysqlnd_conn_data__refresh_server refresh_server;

func_mysqlnd_conn_data__ping ping;
Expand Down