From 92db4a838f9198ab0924b8b876b5991bfe00e8d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Mar 2005 09:59:41 -0800 Subject: Fix reconnect when using prepared statements, and add --disable_reconnect and --enable_reconnect to mysqltest so that it can be tested properly. (Bug #8866) client/mysqltest.c: Add support for --disable_reconnect and --enable_reconnect mysql-test/r/kill.result: Update results mysql-test/t/kill.test: Fix test to actually verify that killing a connection is working, and that automatic reconnect is working as desired. sql-common/client.c: Clean up MYSQL->stmts on reconnect by invalidating statements not in the MYSQL_STMT_INIT_DONE state, and reconnecting others to the new MYSQL object. --- mysql-test/t/kill.test | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mysql-test/t/kill.test') diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 65d4f27059f..4afb60a7bdd 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -23,12 +23,15 @@ connection con2; select ((@id := kill_id) - kill_id) from t1; kill @id; -# Wait for thread to do. ---sleep 5 -# verify that con1 is doning a reconnect connection con1; -ping -ping + +--disable_reconnect +# this statement should fail +--error 2006 +select 1; +--enable_reconnect +# this should work, and we should have a new connection_id() +select ((@id := kill_id) - kill_id) from t1; select @id != connection_id(); #make sure the server is still alive -- cgit v1.2.1