| 1 |
############# mysql-test\t\slow_launch_time_func.test ########################## |
| 2 |
# # |
| 3 |
# Variable Name: slow_launch_time # |
| 4 |
# Scope: SESSION # |
| 5 |
# Access Type: Dynamic # |
| 6 |
# Data Type: NUMERIC # |
| 7 |
# Default Value: 2 # |
| 8 |
# Values: - # |
| 9 |
# # |
| 10 |
# # |
| 11 |
# Creation Date: 2008-03-02 # |
| 12 |
# Author: Sharique Abdullah # |
| 13 |
# # |
| 14 |
# Last change: 2008-09-09 mleich Reimplementation of this test # |
| 15 |
# - Fix Bug#36874 : main.slow_launch_time_func test fails # |
| 16 |
# randomly # |
| 17 |
# - Fix other failures and streamline the test # |
| 18 |
# # |
| 19 |
# Description: Test Cases of Dynamic System Variable "slow_launch_time " # |
| 20 |
# that checks behavior of this variable in the following ways # |
| 21 |
# * Functionality based on different values # |
| 22 |
# # |
| 23 |
# Reference: # |
| 24 |
# http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html # |
| 25 |
# option_mysqld_slow_launch_time # |
| 26 |
# # |
| 27 |
################################################################################ |
| 28 |
|
| 29 |
# |
| 30 |
# Setup |
| 31 |
# |
| 32 |
|
| 33 |
--source include/not_threadpool.inc |
| 34 |
--source include/not_valgrind.inc |
| 35 |
|
| 36 |
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time; |
| 37 |
|
| 38 |
--echo '#--------------------FN_DYNVARS_124_01-------------------------#' |
| 39 |
|
| 40 |
######################################################################## |
| 41 |
# Reveal that a new connect gets counted as "slow launched thread" if # |
| 42 |
# @@GLOBAL.slow_launch_time = 0. # |
| 43 |
# The value of slow_launch_threads must be increased by 1. # |
| 44 |
######################################################################## |
| 45 |
|
| 46 |
SET @@GLOBAL.slow_launch_time=0; |
| 47 |
SELECT @@GLOBAL.slow_launch_time; |
| 48 |
|
| 49 |
let $value_before= |
| 50 |
query_get_value(show status like 'slow_launch_threads', Value, 1); |
| 51 |
--echo ** Connecting conn1 using username 'root' ** |
| 52 |
CONNECT (conn1,localhost,root,,); |
| 53 |
# To assure that the connection has been established. |
| 54 |
SELECT 1; |
| 55 |
let $value_after= |
| 56 |
query_get_value(show status like 'slow_launch_threads', Value, 1); |
| 57 |
if (!`SELECT $value_after = $value_before + 1`) |
| 58 |
{ |
| 59 |
--echo ERROR: Subtest FN_DYNVARS_124_01 failed |
| 60 |
--echo A new connect should be counted as 'slow_launch_thread' if |
| 61 |
--echo @@GLOBAL.slow_launch_time=0 |
| 62 |
SELECT @@GLOBAL.slow_launch_time; |
| 63 |
echo Number of slow_launch_threads before new connect: $value_before; |
| 64 |
echo Number of slow_launch_threads after new connect: $value_after; |
| 65 |
} |
| 66 |
disconnect conn1; |
| 67 |
source include/wait_until_disconnected.inc; |
| 68 |
--echo ** Switch to connection default and disconnect conn1 ** |
| 69 |
connection default; |
| 70 |
|
| 71 |
--echo '#--------------------FN_DYNVARS_124_02-------------------------#' |
| 72 |
|
| 73 |
######################################################################## |
| 74 |
# Reveal that a new connect gets not counted as "slow launched thread" # |
| 75 |
# if @@GLOBAL.slow_launch_time is sufficient big. # |
| 76 |
# The value of slow_launch_threads must not change. # |
| 77 |
######################################################################## |
| 78 |
|
| 79 |
SET @@GLOBAL.slow_launch_time= 10000; |
| 80 |
SELECT @@GLOBAL.slow_launch_time; |
| 81 |
|
| 82 |
let $value_before= |
| 83 |
query_get_value(show status like 'slow_launch_threads', Value, 1); |
| 84 |
--echo ** Connecting conn2 using username 'root' ** |
| 85 |
CONNECT (conn2,localhost,root,,); |
| 86 |
SELECT 1; |
| 87 |
let $value_after= |
| 88 |
query_get_value(show status like 'slow_launch_threads', Value, 1); |
| 89 |
if ($value_after != $value_before) |
| 90 |
{ |
| 91 |
--echo ERROR: Subtest FN_DYNVARS_124_02 failed |
| 92 |
--echo A new connect must not be counted as 'slow_launch_thread' if |
| 93 |
--echo @@GLOBAL.slow_launch_time is sufficient big. |
| 94 |
SELECT @@GLOBAL.slow_launch_time; |
| 95 |
echo Number of slow_launch_threads before new connect: $value_before; |
| 96 |
echo Number of slow_launch_threads after new connect: $value_after; |
| 97 |
} |
| 98 |
|
| 99 |
# |
| 100 |
# Cleanup |
| 101 |
# |
| 102 |
|
| 103 |
--echo ** Switch to connection default and disconnect conn2 ** |
| 104 |
connection default; |
| 105 |
disconnect conn2; |
| 106 |
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time; |