#At file:///home/msvensson/mysql/5.1-rpl/ based on revid:sven@stripped
2713 Magnus Svensson 2009-01-14
Bug#35701 please allow test language variables in connection and sync_slave_with_master
- Additional patch for "disconnect $variable"
modified:
client/mysqltest.cc
mysql-test/r/mysqltest.result
mysql-test/t/mysqltest.test
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2008-12-25 09:53:24 +0000
+++ b/client/mysqltest.cc 2009-01-14 19:10:15 +0000
@@ -4507,24 +4507,23 @@ void select_connection(struct st_command
void do_close_connection(struct st_command *command)
{
- char *p= command->first_argument, *name;
- struct st_connection *con;
-
DBUG_ENTER("close_connection");
- DBUG_PRINT("enter",("name: '%s'",p));
- if (!*p)
- die("Missing connection name in disconnect");
- name= p;
- while (*p && !my_isspace(charset_info,*p))
- p++;
+ struct st_connection *con;
+ static DYNAMIC_STRING ds_connection;
+ const struct command_arg close_connection_args[] = {
+ { "connection_name", ARG_STRING, TRUE, &ds_connection,
+ "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)
- *p++= 0;
- command->last_argument= p;
+ DBUG_PRINT("enter",("connection name: '%s'", ds_connection.str));
- if (!(con= find_connection_by_name(name)))
- die("connection '%s' not found in connection pool", name);
+ if (!(con= find_connection_by_name(ds_connection.str)))
+ die("connection '%s' not found in connection pool", ds_connection.str);
DBUG_PRINT("info", ("Closing connection %s", con->name));
#ifndef EMBEDDED_LIBRARY
@@ -4563,6 +4562,8 @@ void do_close_connection(struct st_comma
if (!(con->name = my_strdup("-closed_connection-", MYF(MY_WME))))
die("Out of memory");
+ set_current_connection(con);
+
DBUG_VOID_RETURN;
}
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2008-10-23 14:23:13 +0000
+++ b/mysql-test/r/mysqltest.result 2009-01-14 19:10:15 +0000
@@ -153,8 +153,12 @@ mysqltest: At line 1: Missing delimiter
mysqltest: At line 1: End of line junk detected: "sleep 7
# Another comment
"
-mysqltest: At line 1: Missing delimiter
-mysqltest: At line 1: Missing delimiter
+mysqltest: At line 1: Extra argument 'comment
+# 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
#
@@ -744,5 +748,7 @@ con1
default
con1
default
+-closed_connection-
con1
+-closed_connection-
End of tests
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2008-10-23 14:23:13 +0000
+++ b/mysql-test/t/mysqltest.test 2009-01-14 19:10:15 +0000
@@ -2203,9 +2203,15 @@ let $y= con1;
connection $x;
--echo $CURRENT_CONNECTION
+disconnect $x;
+--echo $CURRENT_CONNECTION
+
connection $y;
--echo $CURRENT_CONNECTION
+disconnect $y;
+--echo $CURRENT_CONNECTION
+
--echo End of tests
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (msvensson:2713) Bug#35701 | Magnus Svensson | 14 Jan |