summaryrefslogtreecommitdiff
path: root/mysql-test/r/connect.result
diff options
context:
space:
mode:
authorunknown <anozdrin/alik@quad.>2008-03-12 17:44:40 +0300
committerunknown <anozdrin/alik@quad.>2008-03-12 17:44:40 +0300
commitb279be388e1d8208396ada701d3015b9d7cbbc4c (patch)
treefe7296933dc1d17ddfb87e35b61bf5c0a3ed4684 /mysql-test/r/connect.result
parentd80e7ce4e5e8aaae3473c617baaed5454bb520ed (diff)
downloadmariadb-git-b279be388e1d8208396ada701d3015b9d7cbbc4c.tar.gz
Fix for Bug#33507: Event scheduler creates more threads
than max_connections -- which results in user lockout. The problem was that the variable thread_count that contains the number of active threads was interpreted as a number of active connections. The fix is to introduce a new counter for active connections. mysql-test/r/connect.result: A test case for Bug#33507: Event scheduler creates more threads than max_connections -- which results in user lockout. mysql-test/t/connect.test: A test case for Bug#33507: Event scheduler creates more threads than max_connections -- which results in user lockout. sql/mysql_priv.h: 1. Polishing: login_connection() and end_connection() need not to be public. 2. Introduce connection_count -- a variable to contain the number of active connections. It is protected by LOCK_connection_count. sql/mysqld.cc: Use connection_count to count active connections. sql/sql_connect.cc: 1. Use connection_count to count active connections. 2. Make login_connection(), end_connection() private for the module as they had to be.
Diffstat (limited to 'mysql-test/r/connect.result')
-rw-r--r--mysql-test/r/connect.result58
1 files changed, 58 insertions, 0 deletions
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 25cf4f90e6d..de4eb28c500 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -115,3 +115,61 @@ create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
drop table t1;
+# ------------------------------------------------------------------
+# -- End of 4.1 tests
+# ------------------------------------------------------------------
+
+# -- Bug#33507: Event scheduler creates more threads than max_connections
+# -- which results in user lockout.
+
+GRANT USAGE ON *.* TO mysqltest_u1@localhost;
+
+SET GLOBAL max_connections = 3;
+SET GLOBAL event_scheduler = ON;
+
+# -- Waiting for old connections to close...
+
+
+# -- Disconnecting default connection...
+
+# -- Check that we allow exactly three user connections, no matter how
+# -- many threads are running.
+
+# -- Connecting (1)...
+
+# -- Waiting for root connection to close...
+
+# -- Connecting (2)...
+# -- Connecting (3)...
+# -- Connecting (4)...
+ERROR 08004: Too many connections
+
+# -- Waiting for the last connection to close...
+
+# -- Check that we allow one extra SUPER-user connection.
+
+# -- Connecting super (1)...
+# -- Connecting super (2)...
+ERROR 00000: Too many connections
+
+SELECT user FROM information_schema.processlist ORDER BY id;
+user
+event_scheduler
+mysqltest_u1
+mysqltest_u1
+mysqltest_u1
+root
+
+# -- Resetting variables...
+SET GLOBAL max_connections = 151;
+SET GLOBAL event_scheduler = OFF;
+
+# -- That's it. Closing connections...
+
+# -- Restoring default connection...
+
+# -- End of Bug#33507.
+
+# ------------------------------------------------------------------
+# -- End of 5.1 tests
+# ------------------------------------------------------------------