Loading client/mysqltest.c +57 −65 Original line number Diff line number Diff line Loading @@ -2983,6 +2983,21 @@ void do_diff_files(struct st_command *command) DBUG_VOID_RETURN; } struct st_connection * find_connection_by_name(const char *name) { struct st_connection *con; for (con= connections; con < next_con; con++) { if (!strcmp(con->name, name)) { return con; } } return 0; /* Connection not found */ } /* SYNOPSIS do_send_quit Loading @@ -3002,7 +3017,7 @@ void do_send_quit(struct st_command *command) DBUG_PRINT("enter",("name: '%s'",p)); if (!*p) die("Missing connection name in do_send_quit"); die("Missing connection name in send_quit"); name= p; while (*p && !my_isspace(charset_info,*p)) p++; Loading @@ -3011,18 +3026,13 @@ void do_send_quit(struct st_command *command) *p++= 0; command->last_argument= p; /* Loop through connection pool for connection to close */ for (con= connections; con < next_con; con++) { DBUG_PRINT("info", ("con->name: %s", con->name)); if (!strcmp(con->name, name)) { if (!(con= find_connection_by_name(name))) die("connection '%s' not found in connection pool", name); simple_command(&con->mysql,COM_QUIT,NullS,0,1); DBUG_VOID_RETURN; } } die("connection '%s' not found in connection pool", name); } /* Loading Loading @@ -3858,20 +3868,6 @@ void set_reconnect(MYSQL* mysql, int val) } struct st_connection * find_connection_by_name(const char *name) { struct st_connection *con; for (con= connections; con < next_con; con++) { if (!strcmp(con->name, name)) { return con; } } return 0; /* Connection not found */ } int select_connection_name(const char *name) { DBUG_ENTER("select_connection2"); Loading Loading @@ -3919,12 +3915,9 @@ void do_close_connection(struct st_command *command) *p++= 0; command->last_argument= p; /* Loop through connection pool for connection to close */ for (con= connections; con < next_con; con++) { DBUG_PRINT("info", ("con->name: %s", con->name)); if (!strcmp(con->name, name)) { if (!(con= find_connection_by_name(name))) die("connection '%s' not found in connection pool", name); DBUG_PRINT("info", ("Closing connection %s", con->name)); #ifndef EMBEDDED_LIBRARY if (command->type == Q_DIRTY_CLOSE) Loading @@ -3936,14 +3929,16 @@ void do_close_connection(struct st_command *command) } } #endif if (next_con->stmt) mysql_stmt_close(next_con->stmt); next_con->stmt= 0; if (con->stmt) mysql_stmt_close(con->stmt); con->stmt= 0; mysql_close(&con->mysql); if (con->util_mysql) mysql_close(con->util_mysql); con->util_mysql= 0; my_free(con->name, MYF(0)); /* Loading @@ -3955,9 +3950,6 @@ void do_close_connection(struct st_command *command) DBUG_VOID_RETURN; } } die("connection '%s' not found in connection pool", name); } /* Loading Loading
client/mysqltest.c +57 −65 Original line number Diff line number Diff line Loading @@ -2983,6 +2983,21 @@ void do_diff_files(struct st_command *command) DBUG_VOID_RETURN; } struct st_connection * find_connection_by_name(const char *name) { struct st_connection *con; for (con= connections; con < next_con; con++) { if (!strcmp(con->name, name)) { return con; } } return 0; /* Connection not found */ } /* SYNOPSIS do_send_quit Loading @@ -3002,7 +3017,7 @@ void do_send_quit(struct st_command *command) DBUG_PRINT("enter",("name: '%s'",p)); if (!*p) die("Missing connection name in do_send_quit"); die("Missing connection name in send_quit"); name= p; while (*p && !my_isspace(charset_info,*p)) p++; Loading @@ -3011,18 +3026,13 @@ void do_send_quit(struct st_command *command) *p++= 0; command->last_argument= p; /* Loop through connection pool for connection to close */ for (con= connections; con < next_con; con++) { DBUG_PRINT("info", ("con->name: %s", con->name)); if (!strcmp(con->name, name)) { if (!(con= find_connection_by_name(name))) die("connection '%s' not found in connection pool", name); simple_command(&con->mysql,COM_QUIT,NullS,0,1); DBUG_VOID_RETURN; } } die("connection '%s' not found in connection pool", name); } /* Loading Loading @@ -3858,20 +3868,6 @@ void set_reconnect(MYSQL* mysql, int val) } struct st_connection * find_connection_by_name(const char *name) { struct st_connection *con; for (con= connections; con < next_con; con++) { if (!strcmp(con->name, name)) { return con; } } return 0; /* Connection not found */ } int select_connection_name(const char *name) { DBUG_ENTER("select_connection2"); Loading Loading @@ -3919,12 +3915,9 @@ void do_close_connection(struct st_command *command) *p++= 0; command->last_argument= p; /* Loop through connection pool for connection to close */ for (con= connections; con < next_con; con++) { DBUG_PRINT("info", ("con->name: %s", con->name)); if (!strcmp(con->name, name)) { if (!(con= find_connection_by_name(name))) die("connection '%s' not found in connection pool", name); DBUG_PRINT("info", ("Closing connection %s", con->name)); #ifndef EMBEDDED_LIBRARY if (command->type == Q_DIRTY_CLOSE) Loading @@ -3936,14 +3929,16 @@ void do_close_connection(struct st_command *command) } } #endif if (next_con->stmt) mysql_stmt_close(next_con->stmt); next_con->stmt= 0; if (con->stmt) mysql_stmt_close(con->stmt); con->stmt= 0; mysql_close(&con->mysql); if (con->util_mysql) mysql_close(con->util_mysql); con->util_mysql= 0; my_free(con->name, MYF(0)); /* Loading @@ -3955,9 +3950,6 @@ void do_close_connection(struct st_command *command) DBUG_VOID_RETURN; } } die("connection '%s' not found in connection pool", name); } /* Loading