Bug#35701 please allow test language variables in connection and
sync_slave_with_master - Additional patch for "disconnect $variable"
This commit is contained in:
parent
d20aba9409
commit
bb42e1ab05
@ -4507,24 +4507,23 @@ void select_connection(struct st_command *command)
|
|||||||
|
|
||||||
void do_close_connection(struct st_command *command)
|
void do_close_connection(struct st_command *command)
|
||||||
{
|
{
|
||||||
char *p= command->first_argument, *name;
|
|
||||||
struct st_connection *con;
|
|
||||||
|
|
||||||
DBUG_ENTER("close_connection");
|
DBUG_ENTER("close_connection");
|
||||||
DBUG_PRINT("enter",("name: '%s'",p));
|
|
||||||
|
|
||||||
if (!*p)
|
struct st_connection *con;
|
||||||
die("Missing connection name in disconnect");
|
static DYNAMIC_STRING ds_connection;
|
||||||
name= p;
|
const struct command_arg close_connection_args[] = {
|
||||||
while (*p && !my_isspace(charset_info,*p))
|
{ "connection_name", ARG_STRING, TRUE, &ds_connection,
|
||||||
p++;
|
"Name of the connection to close." }
|
||||||
|
};
|
||||||
|
check_command_args(command, command->first_argument,
|
||||||
|
close_connection_args,
|
||||||
|
sizeof(close_connection_args)/sizeof(struct command_arg),
|
||||||
|
' ');
|
||||||
|
|
||||||
if (*p)
|
DBUG_PRINT("enter",("connection name: '%s'", ds_connection.str));
|
||||||
*p++= 0;
|
|
||||||
command->last_argument= p;
|
|
||||||
|
|
||||||
if (!(con= find_connection_by_name(name)))
|
if (!(con= find_connection_by_name(ds_connection.str)))
|
||||||
die("connection '%s' not found in connection pool", name);
|
die("connection '%s' not found in connection pool", ds_connection.str);
|
||||||
|
|
||||||
DBUG_PRINT("info", ("Closing connection %s", con->name));
|
DBUG_PRINT("info", ("Closing connection %s", con->name));
|
||||||
#ifndef EMBEDDED_LIBRARY
|
#ifndef EMBEDDED_LIBRARY
|
||||||
@ -4563,6 +4562,13 @@ void do_close_connection(struct st_command *command)
|
|||||||
if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
|
if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
|
||||||
die("Out of memory");
|
die("Out of memory");
|
||||||
|
|
||||||
|
if (con == cur_con)
|
||||||
|
{
|
||||||
|
/* Current connection was closed */
|
||||||
|
var_set_int("$mysql_get_server_version", 0xFFFFFFFF);
|
||||||
|
var_set_string("$CURRENT_CONNECTION", con->name);
|
||||||
|
}
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +153,12 @@ mysqltest: At line 1: Missing delimiter
|
|||||||
mysqltest: At line 1: End of line junk detected: "sleep 7
|
mysqltest: At line 1: End of line junk detected: "sleep 7
|
||||||
# Another comment
|
# Another comment
|
||||||
"
|
"
|
||||||
mysqltest: At line 1: Missing delimiter
|
mysqltest: At line 1: Extra argument 'comment
|
||||||
mysqltest: At line 1: Missing delimiter
|
# comment 3
|
||||||
|
disable_query_log' passed to 'disconnect'
|
||||||
|
mysqltest: At line 1: Extra argument 'comment
|
||||||
|
# comment 3
|
||||||
|
disable_query_log' passed to 'disconnect'
|
||||||
mysqltest: At line 1: End of line junk detected: "disconnect default
|
mysqltest: At line 1: End of line junk detected: "disconnect default
|
||||||
|
|
||||||
#
|
#
|
||||||
@ -745,4 +749,6 @@ default
|
|||||||
con1
|
con1
|
||||||
default
|
default
|
||||||
con1
|
con1
|
||||||
|
con1
|
||||||
|
-closed_connection-
|
||||||
End of tests
|
End of tests
|
||||||
|
@ -2206,6 +2206,14 @@ connection $x;
|
|||||||
connection $y;
|
connection $y;
|
||||||
--echo $CURRENT_CONNECTION
|
--echo $CURRENT_CONNECTION
|
||||||
|
|
||||||
|
# Disconnect the not selected connection
|
||||||
|
disconnect $x;
|
||||||
|
--echo $CURRENT_CONNECTION
|
||||||
|
|
||||||
|
# Disconnect the selected connection
|
||||||
|
disconnect $y;
|
||||||
|
--echo $CURRENT_CONNECTION
|
||||||
|
|
||||||
|
|
||||||
--echo End of tests
|
--echo End of tests
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user