summaryrefslogtreecommitdiff
path: root/sql/sql_connect.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2009-09-08 00:50:10 +0400
committerSergey Petrunya <psergey@askmonty.org>2009-09-08 00:50:10 +0400
commit29f0dcb56337a3e352ad7a70dcff6b25bb605325 (patch)
tree84935c21dc958724ae7dcbeeca0c0f08986fc430 /sql/sql_connect.cc
parent915a624cbcb58a10a2cfb2e2e4fd5029191fa86a (diff)
parent8a2454f8e9fce648272577fcf8006ae6e6806cf9 (diff)
downloadmariadb-git-29f0dcb56337a3e352ad7a70dcff6b25bb605325.tar.gz
Merge MySQL->MariaDB
* Finished Monty and Jani's merge * Some InnoDB tests still fail (because it's old xtradb code run against newer testsuite). They are expected to go after mergning with the latest xtradb.
Diffstat (limited to 'sql/sql_connect.cc')
-rw-r--r--sql/sql_connect.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 1b6c337a43e..8f02828e18c 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1077,8 +1077,8 @@ void prepare_new_connection_state(THD* thd)
pthread_handler_t handle_one_connection(void *arg)
{
THD *thd= (THD*) arg;
- ulong launch_time= (ulong) ((thd->thr_create_utime= my_micro_time()) -
- thd->connect_utime);
+
+ thd->thr_create_utime= my_micro_time();
if (thread_scheduler.init_new_connection_thread())
{
@@ -1087,8 +1087,20 @@ pthread_handler_t handle_one_connection(void *arg)
thd->scheduler->end_thread(thd,0);
return 0;
}
- if (launch_time >= slow_launch_time*1000000L)
- statistic_increment(slow_launch_threads,&LOCK_status);
+
+ /*
+ If a thread was created to handle this connection:
+ increment slow_launch_threads counter if it took more than
+ slow_launch_time seconds to create the thread.
+ */
+ if (thd->prior_thr_create_utime)
+ {
+ ulong launch_time= (ulong) (thd->thr_create_utime -
+ thd->prior_thr_create_utime);
+ if (launch_time >= slow_launch_time*1000000L)
+ statistic_increment(slow_launch_threads, &LOCK_status);
+ thd->prior_thr_create_utime= 0;
+ }
/*
handle_one_connection() is normally the only way a thread would