From 8d33101179a3983b04c5314a9600229ff012d02f Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Fri, 20 Nov 2009 23:30:00 +0300 Subject: Backport of: ------------------------------------------------------------ revno: 2572.23.1 committer: davi@mysql.com/endora.local timestamp: Wed 2008-03-19 09:03:08 -0300 message: Bug#17954 Threads_connected > Threads_created The problem is that insert delayed threads are counted as connected but not as created, leading to a Threads_connected value greater then the Threads_created value. The solution is to enforce the documented behavior that the Threads_connected value shall be the number of currently open connections and that Threads_created shall be the number of threads created to handle connections. mysql-test/r/status.result: Add test case result for Bug#17954 mysql-test/t/status.test: Add test case for Bug#17954 sql/mysqld.cc: Change Threads_connected to reflect the number of open connections. SHOW_INT type variables are not reset. --- mysql-test/r/status.result | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mysql-test/r') diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result index ce3acba9b8a..c0cd0f7bc1a 100644 --- a/mysql-test/r/status.result +++ b/mysql-test/r/status.result @@ -238,5 +238,11 @@ SELECT 9; 9 DROP PROCEDURE p1; DROP FUNCTION f1; +DROP VIEW IF EXISTS v1; +CREATE VIEW v1 AS SELECT VARIABLE_NAME AS NAME, CONVERT(VARIABLE_VALUE, UNSIGNED) AS VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS; +SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected'; +SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc; +NAME +DROP VIEW v1; set @@global.concurrent_insert= @old_concurrent_insert; SET GLOBAL log_output = @old_log_output; -- cgit v1.2.1