#At file:///mnt/raid/alik/MySQL/bzr/bug42384/6.0-rt-bug42384.2/ based on revid:alik@stripped
2752 Alexander Nozdrin 2009-03-26
A patch for Bug#42384 (thread_handling = pool-of-threads,
wrong handling of max_questions user limit).
The problem was that in case of pool-of-threads a thd object
was not properly initialized, i.e. thr_create_time and start_utime
were not set. So, time_out_user_resource_limits(), that is
essential for handling user limits, was not able to work properly.
The fix is to initialize forgotten attributes properly.
modified:
mysql-test/t/disabled.def
mysql-test/t/user_limits.test
sql/scheduler.cc
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2009-02-18 10:23:38 +0000
+++ b/mysql-test/t/disabled.def 2009-03-26 09:04:25 +0000
@@ -14,6 +14,5 @@ csv_alter_table : Bug#42831 main.cs
cast : Bug#35594 2008-03-27 main.cast fails on Windows2003-64
events_bugs : Bug#37774 Bug#39569 Bug#39863 Bug#39848 2008-10-08 alik
innodb : Bug#41299 2008-12-08 alik
-user_limits : Bug#42384 thread_handling = pool-of-threads, wrong handling of max_questions user limit
query_cache_28249 : Bug#41098 Query Cache returns wrong result with concurrent insert
innodb_bug39438 : BUG#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently"
=== modified file 'mysql-test/t/user_limits.test'
--- a/mysql-test/t/user_limits.test 2009-01-28 10:53:43 +0000
+++ b/mysql-test/t/user_limits.test 2009-03-26 09:04:25 +0000
@@ -5,23 +5,6 @@
# Requires privileges to be enabled
-- source include/not_embedded.inc
-# <-- Start the cut here
-# As long as
-# Bug#42384 thread_handling = pool-of-threads, wrong handling of max_questions
-# user limit
-# is not fixed this test will fail when the server was started with
-# "pool-of-threads".
-# Please set $fixed_bug_42384 to 1 when checking if the fix for Bug#42384 works.
-# If everything is fine, please remove the lines between the markers.
-let $fixed_bug_42384 = 0;
-let $my_val= query_get_value(show variables like 'thread_handling', Value, 1);
-if (`SELECT $fixed_bug_42384 = 0 AND '$my_val' = 'pool-of-threads'`)
-{
- --skip Bug#42384 thread_handling = pool-of-threads, wrong handling of max_questions user limit
- exit;
-}
-# <-- End the cut here
-
# Prepare play-ground
--disable_warnings
drop table if exists t1;
=== modified file 'sql/scheduler.cc'
--- a/sql/scheduler.cc 2009-02-16 18:22:48 +0000
+++ b/sql/scheduler.cc 2009-03-26 09:04:25 +0000
@@ -461,6 +461,10 @@ static void libevent_add_connection(THD
libevent_connection_close(thd);
DBUG_VOID_RETURN;
}
+
+ thd->set_time();
+ thd->thr_create_utime= my_micro_time();
+
threads.append(thd);
libevent_thd_add(thd);
Attachment: [text/bzr-bundle] bzr/alik@sun.com-20090326090425-cein0jhoqmd54ql9.bundle
| Thread |
|---|
| • bzr commit into mysql-6.0 branch (alik:2752) Bug#42384 | Alexander Nozdrin | 26 Mar |