From 253439874a83641a9ab19dfa6398874ce69bb83d Mon Sep 17 00:00:00 2001 From: "davi@moksha.com.br" <> Date: Wed, 17 Oct 2007 16:43:30 -0300 Subject: [PATCH] Bug#31608 missing mysqltest change_user command Post merge fixes: close any open statement before the change user command and fix test case output. --- client/mysqltest.c | 6 ++++++ mysql-test/r/change_user.result | 4 ++-- mysql-test/t/change_user.test | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 7a84ec8cf40..90df546babf 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3063,6 +3063,12 @@ void do_change_user(struct st_command *command) sizeof(change_user_args)/sizeof(struct command_arg), ','); + if (cur_con->stmt) + { + mysql_stmt_close(cur_con->stmt); + cur_con->stmt= NULL; + } + if (!ds_user.length) dynstr_set(&ds_user, mysql->user); diff --git a/mysql-test/r/change_user.result b/mysql-test/r/change_user.result index d0dfa855add..cb409621d56 100644 --- a/mysql-test/r/change_user.result +++ b/mysql-test/r/change_user.result @@ -34,8 +34,8 @@ NULL SELECT GET_LOCK('bug31418', 1); GET_LOCK('bug31418', 1) 1 -SELECT IS_USED_LOCK('bug31418'); -IS_USED_LOCK('bug31418') +SELECT IS_USED_LOCK('bug31418') = CONNECTION_ID(); +IS_USED_LOCK('bug31418') = CONNECTION_ID() 1 change_user SELECT IS_FREE_LOCK('bug31418'); diff --git a/mysql-test/t/change_user.test b/mysql-test/t/change_user.test index 2900cd434a4..d0cdfc8a741 100644 --- a/mysql-test/t/change_user.test +++ b/mysql-test/t/change_user.test @@ -28,7 +28,7 @@ SELECT @@session.sql_big_selects; SELECT IS_FREE_LOCK('bug31418'); SELECT IS_USED_LOCK('bug31418'); SELECT GET_LOCK('bug31418', 1); -SELECT IS_USED_LOCK('bug31418'); +SELECT IS_USED_LOCK('bug31418') = CONNECTION_ID(); --echo change_user --change_user SELECT IS_FREE_LOCK('bug31418');