summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2013-05-23 14:52:48 +0200
committerVladislav Vaintroub <wlad@montyprogram.com>2013-05-23 14:52:48 +0200
commit08ce9bfe057b6cd31e7fbca4e4e9e48edde242fb (patch)
tree3882462528dc16c79cb55a3528d2998997e7a320 /mysql-test
parent52045d40d4fe0df0e60fa37eb35609fcb0fd857a (diff)
downloadmariadb-git-08ce9bfe057b6cd31e7fbca4e4e9e48edde242fb.tar.gz
MDEV-4566 : Failing DBUG_ASSERT() in SELECT SLEEP(), with threadpool.
This bug only happens with long sleep()s ( > 5 sec), and in debug version. Analysis: The assertion is caused by nested thd_wait_begin() calls, which is not an expected condition. - "outer" thd_wait_begin()) , in Item_func_sleep::val_int() - "inner" thd_wait_begin() in Interruptible_wait::wait(). This function periodically checks whether connection is still valid, via THD::is_connection(), which ends up calling vio_io_wait() with timeout parameter set to 0. Fix is not to call thd wait callback in vio_io_wait(), if timeout parameter is 0. There is no "waiting" in this case.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/pool_of_threads.result4
-rw-r--r--mysql-test/t/pool_of_threads.test5
2 files changed, 6 insertions, 3 deletions
diff --git a/mysql-test/r/pool_of_threads.result b/mysql-test/r/pool_of_threads.result
index 7acb45121d6..c151805e151 100644
--- a/mysql-test/r/pool_of_threads.result
+++ b/mysql-test/r/pool_of_threads.result
@@ -2157,10 +2157,10 @@ Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
SET optimizer_switch=@save_optimizer_switch;
-SELECT sleep(5);
+SELECT sleep(5.5);
SELECT sleep(5);
# -- Success: more than --thread_pool_max_threads normal connections not possible
-sleep(5)
+sleep(5.5)
0
sleep(5)
0
diff --git a/mysql-test/t/pool_of_threads.test b/mysql-test/t/pool_of_threads.test
index 4600128ff43..24e0218db62 100644
--- a/mysql-test/t/pool_of_threads.test
+++ b/mysql-test/t/pool_of_threads.test
@@ -17,7 +17,10 @@ SET optimizer_switch=@save_optimizer_switch;
# First set two connections running, and check that extra connection
# on normal port fails due to--thread-pool-max_threads=2
connection default;
-send SELECT sleep(5);
+
+# Sleep for slightly longer than 5 sec to trigger MDEV-4566
+# (abort in interruptible wait connection check)
+send SELECT sleep(5.5);
--sleep 1
connect(con2,localhost,root,,);