Debian Codegraph @

mysql-test/suite/sys_vars/t/slow_launch_time_func.test

raw
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 --source include/one_thread_per_connection.inc
33 SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
34
35 connection default;
36
37 --echo '#--------------------FN_DYNVARS_124_01-------------------------#'
38
39 ########################################################################
40 # Reveal that a new connect gets counted as "slow launched thread" if #
41 # @@GLOBAL.slow_launch_time = 0. #
42 # The value of slow_launch_threads must be increased by 1. #
43 ########################################################################
44
45 SET @@GLOBAL.slow_launch_time=0;
46 SELECT @@GLOBAL.slow_launch_time;
47
48 let $value_before=
49 query_get_value(show status like 'slow_launch_threads', Value, 1);
50 CONNECT (conn1,localhost,root,,);
51 let $value_after=
52 query_get_value(show status like 'slow_launch_threads', Value, 1);
53 if (!`SELECT $value_after = $value_before + 1`)
54 {
55 --echo ERROR: Subtest FN_DYNVARS_124_01 failed
56 --echo A new connect should be counted as 'slow_launch_thread' if
57 --echo @@GLOBAL.slow_launch_time=0
58 SELECT @@GLOBAL.slow_launch_time;
59 echo Number of slow_launch_threads before new connect: $value_before;
60 echo Number of slow_launch_threads after new connect: $value_after;
61 }
62 connection default;
63 disconnect conn1;
64
65 --echo '#--------------------FN_DYNVARS_124_02-------------------------#'
66
67 ########################################################################
68 # Reveal that a new connect gets not counted as "slow launched thread" #
69 # if @@GLOBAL.slow_launch_time is sufficient big. #
70 # The value of slow_launch_threads must not change. #
71 ########################################################################
72
73 SET @@GLOBAL.slow_launch_time= 1000;
74 SELECT @@GLOBAL.slow_launch_time;
75
76 let $value_before=
77 query_get_value(show status like 'slow_launch_threads', Value, 1);
78 CONNECT (conn2,localhost,root,,);
79 let $value_after=
80 query_get_value(show status like 'slow_launch_threads', Value, 1);
81 if ($value_after != $value_before)
82 {
83 --echo ERROR: Subtest FN_DYNVARS_124_02 failed
84 --echo A new connect must not be counted as 'slow_launch_thread' if
85 --echo @@GLOBAL.slow_launch_time is sufficient big.
86 SELECT @@GLOBAL.slow_launch_time;
87 echo Number of slow_launch_threads before new connect: $value_before;
88 echo Number of slow_launch_threads after new connect: $value_after;
89 }
90
91 #
92 # Cleanup
93 #
94
95 connection default;
96 disconnect conn2;
97 SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;