Skip to content
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

Drop unused variables #18023

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions ext/mysqlnd/mysqlnd_auth.c
Original file line number Diff line number Diff line change
@@ -487,10 +487,6 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
}
if (ret == PASS) {
ZEND_ASSERT(conn->username.s != user && conn->password.s != passwd);
mysqlnd_set_persistent_string(&conn->username, user, user_len, conn->persistent);
mysqlnd_set_persistent_string(&conn->password, passwd, passwd_len, conn->persistent);

mysqlnd_set_string(&conn->last_message, NULL, 0);
UPSERT_STATUS_RESET(conn->upsert_status);
/* set charset for old servers */
3 changes: 0 additions & 3 deletions ext/mysqlnd/mysqlnd_commands.c
Original file line number Diff line number Diff line change
@@ -107,9 +107,6 @@ MYSQLND_METHOD(mysqlnd_command, init_db)(MYSQLND_CONN_DATA * const conn, const M
a protocol of giving back -1. Thus we have to follow it :(
*/
UPSERT_STATUS_SET_AFFECTED_ROWS_TO_ERROR(conn->upsert_status);
if (ret == PASS) {
mysqlnd_set_persistent_string(&conn->connect_or_select_db, db.s, db.l, conn->persistent);
}

DBG_RETURN(ret);
}
21 changes: 4 additions & 17 deletions ext/mysqlnd/mysqlnd_connection.c
Original file line number Diff line number Diff line change
@@ -282,11 +282,6 @@ MYSQLND_METHOD(mysqlnd_conn_data, free_contents)(MYSQLND_CONN_DATA * conn)

DBG_INF("Freeing memory of members");

mysqlnd_set_persistent_string(&conn->hostname, NULL, 0, pers);
mysqlnd_set_persistent_string(&conn->username, NULL, 0, pers);
mysqlnd_set_persistent_string(&conn->password, NULL, 0, pers);
mysqlnd_set_persistent_string(&conn->connect_or_select_db, NULL, 0, pers);
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);

@@ -658,22 +653,16 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
if (transport.s) {
mnd_sprintf_free(transport.s);
transport.s = NULL;
}

if (!conn->scheme.s) {
} else {
goto err; /* OOM */
}

mysqlnd_set_persistent_string(&conn->username, username.s, username.l, conn->persistent);
mysqlnd_set_persistent_string(&conn->password, username.s, password.l, conn->persistent);
conn->port = port;
mysqlnd_set_persistent_string(&conn->connect_or_select_db, database.s, database.l, conn->persistent);

if (!unix_socket && !named_pipe) {
mysqlnd_set_persistent_string(&conn->hostname, hostname.s, hostname.l, conn->persistent);
{
char *p;
mnd_sprintf(&p, 0, "%s via TCP/IP", conn->hostname.s);
mnd_sprintf(&p, 0, "%s via TCP/IP", hostname.s);
if (!p) {
SET_OOM_ERROR(conn->error_info);
goto err; /* OOM */
@@ -682,12 +671,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
mnd_sprintf_free(p);
}
} else {
conn->unix_socket.s = mnd_pestrdup(socket_or_pipe.s, conn->persistent);
if (unix_socket) {
conn->host_info = mnd_pestrdup("Localhost via UNIX socket", conn->persistent);
} else if (named_pipe) {
char *p;
mnd_sprintf(&p, 0, "%s via named pipe", conn->unix_socket.s);
mnd_sprintf(&p, 0, "%s via named pipe", socket_or_pipe.s);
if (!p) {
SET_OOM_ERROR(conn->error_info);
goto err; /* OOM */
@@ -697,11 +685,10 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn,
} else {
php_error_docref(NULL, E_WARNING, "Impossible. Should be either socket or a pipe. Report a bug!");
}
if (!conn->unix_socket.s || !conn->host_info) {
if (!socket_or_pipe.s || !conn->host_info) {
SET_OOM_ERROR(conn->error_info);
goto err; /* OOM */
}
conn->unix_socket.l = strlen(conn->unix_socket.s);
}

SET_EMPTY_ERROR(conn->error_info);
3 changes: 0 additions & 3 deletions ext/mysqlnd/mysqlnd_structs.h
Original file line number Diff line number Diff line change
@@ -890,8 +890,6 @@ struct st_mysqlnd_connection_data
MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * payload_decoder_factory;

/* Information related */
MYSQLND_STRING hostname;
MYSQLND_STRING unix_socket;
MYSQLND_STRING username;
MYSQLND_STRING password;
MYSQLND_STRING scheme;
@@ -901,7 +899,6 @@ struct st_mysqlnd_connection_data
MYSQLND_STRING authentication_plugin_data;
const MYSQLND_CHARSET *charset;
const MYSQLND_CHARSET *greet_charset;
MYSQLND_STRING connect_or_select_db;
MYSQLND_INFILE infile;
unsigned int protocol_version;
unsigned int port;
Loading
Oops, something went wrong.