From ed64190b232ed23974bc0dc11e8b586d8bfb6c71 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 6 Jan 2010 12:56:22 +0100 Subject: [PATCH] Bug #49269 mysqltest crashes on 'reap' if query executed after 'send' Small amendment: ignore pending reap when switching connection, add test --- client/mysqltest.cc | 1 + mysql-test/r/mysqltest.result | 7 +++++++ mysql-test/t/mysqltest.test | 12 ++++++++++++ 3 files changed, 20 insertions(+) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 804db8fbefe..d0c58d2f57b 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -4622,6 +4622,7 @@ void select_connection_name(const char *name) if (!con) die("connection '%s' not found in connection pool", name); + con->pending= FALSE; set_current_connection(con); DBUG_VOID_RETURN; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index e77dcd7b0a6..def5d202c2f 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -542,6 +542,13 @@ f1 Abcd mysqltest: At line 2: Cannot run query on connection between send and reap select * from t1;; +select * from t1;; +select 1; +1 +1 +select 2; +2 +2 drop table t1; mysqltest: At line 1: Missing required argument 'filename' to command 'remove_file' mysqltest: At line 1: Missing required argument 'filename' to command 'write_file' diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index 45fc0715312..f3fea9348e4 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -1654,6 +1654,18 @@ EOF --exec $MYSQL_TEST < $MYSQLTEST_VARDIR/tmp/mysqltest.in 2>&1 remove_file $MYSQLTEST_VARDIR/tmp/mysqltest.in; +# 7. Test that stmt after send without reap IS allowed +# if we have switched connections + +connect (test_con1,localhost,root,,); +--send select * from t1; +connection default; +select 1; +connection test_con1; +select 2; +disconnect test_con1; +connection default; + drop table t1; # ----------------------------------------------------------------------------