2016-02-01 11:45:39 +01:00
|
|
|
# This test is to check various cases of connections, some which require
|
|
|
|
# DBUG
|
|
|
|
|
|
|
|
# This test makes no sense with the embedded server
|
|
|
|
--source include/not_embedded.inc
|
|
|
|
--source include/have_debug.inc
|
2016-03-09 10:19:09 +01:00
|
|
|
call mtr.add_suppression("Allocation failed");
|
2016-02-01 11:45:39 +01:00
|
|
|
SET @old_debug= @@session.debug;
|
|
|
|
set @old_thread_cache_size=@@global.thread_cache_size;
|
|
|
|
|
|
|
|
# Test connections to the
|
|
|
|
|
|
|
|
connect(con1,localhost,root,,test,,);
|
|
|
|
select 1;
|
|
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug='+d,simulate_failed_connection_1';
|
|
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
2016-03-08 10:28:26 +01:00
|
|
|
--error 1041,2013
|
2016-02-01 11:45:39 +01:00
|
|
|
connect(con1,localhost,root,,test,,);
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug=@old_debug;
|
|
|
|
set global debug_dbug='+d,simulate_failed_connection_2';
|
|
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
2016-03-08 10:28:26 +01:00
|
|
|
--error 1041,2013
|
2016-02-01 11:45:39 +01:00
|
|
|
connect(con1,localhost,root,,test,,);
|
2016-03-08 10:28:26 +01:00
|
|
|
--enable_result_log
|
2016-02-01 11:45:39 +01:00
|
|
|
connection default;
|
|
|
|
set global debug_dbug=@old_debug;
|
|
|
|
connect(con1,localhost,root,,test,,);
|
|
|
|
select 1;
|
|
|
|
disconnect con1;
|
|
|
|
|
|
|
|
# Test connections to the extra port.
|
|
|
|
|
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
select 1;
|
|
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug='+d,simulate_failed_connection_1';
|
|
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_EXTRA_PORT MASTER_PORT
|
2016-03-08 10:28:26 +01:00
|
|
|
--error 1041,2013
|
2016-02-01 11:45:39 +01:00
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug=@old_debug;
|
|
|
|
set global debug_dbug='+d,simulate_failed_connection_2';
|
|
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_EXTRA_PORT MASTER_PORT
|
2016-03-08 10:28:26 +01:00
|
|
|
--error 1041,2013
|
2016-02-01 11:45:39 +01:00
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug=@old_debug;
|
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
select 1;
|
|
|
|
disconnect con1;
|
|
|
|
connection default;
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test thread cache
|
|
|
|
#
|
|
|
|
set @@global.thread_cache_size=2;
|
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
select 1;
|
|
|
|
connect(con2,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
select 1;
|
|
|
|
disconnect con1;
|
|
|
|
disconnect con2;
|
|
|
|
connection default;
|
|
|
|
set global debug_dbug='+d,simulate_failed_connection_2';
|
|
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_EXTRA_PORT MASTER_PORT
|
2016-03-08 10:28:26 +01:00
|
|
|
--error 1041,2013
|
2016-02-01 11:45:39 +01:00
|
|
|
connect(con1,localhost,root,,test,$MASTER_EXTRA_PORT,);
|
|
|
|
connection default;
|
|
|
|
|
|
|
|
# Check that threads_connected didn't count aborted connections
|
2016-02-28 11:54:56 +01:00
|
|
|
let $count_sessions= 1;
|
|
|
|
--source include/wait_until_count_sessions.inc
|
2016-02-01 11:45:39 +01:00
|
|
|
show status like "Threads_connected";
|
|
|
|
|
|
|
|
#
|
|
|
|
# Cleanup
|
|
|
|
#
|
|
|
|
|
|
|
|
set global debug_dbug=@old_debug;
|
|
|
|
set global thread_cache_size=@old_thread_cache_size;
|