File: slow_launch_time_func.test

package info (click to toggle)
mysql-5.5 5.5.60-0%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 201,012 kB
  • sloc: cpp: 648,063; ansic: 552,041; perl: 48,017; pascal: 25,099; sh: 15,065; yacc: 13,088; cs: 4,647; xml: 4,178; sql: 3,380; makefile: 1,368; lex: 639; awk: 54
file content (105 lines) | stat: -rw-r--r-- 4,995 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
############# mysql-test\t\slow_launch_time_func.test ##########################
#                                                                              #
# Variable Name: slow_launch_time                                              #
# Scope: SESSION                                                               #
# Access Type: Dynamic                                                         #
# Data Type: NUMERIC                                                           #
# Default Value: 2                                                             #
# Values:      -                                                               #
#                                                                              #
#                                                                              #
# Creation Date: 2008-03-02                                                    #
# Author:  Sharique Abdullah                                                   #
#                                                                              #
# Last change: 2008-09-09 mleich Reimplementation of this test                 #
#              - Fix Bug#36874 : main.slow_launch_time_func test fails         #
#                randomly                                                      #
#              - Fix other failures and streamline the test                    #
#                                                                              #
# Description: Test Cases of Dynamic System Variable "slow_launch_time "       #
#              that checks behavior of this variable in the following ways     #
#              * Functionality based on different values                       #
#                                                                              #
# Reference:                                                                   #
#    http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html       #
#           option_mysqld_slow_launch_time                                     #
#                                                                              #
################################################################################

#
# Setup
#

--source include/not_embedded.inc
--source include/not_threadpool.inc

SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;

--echo ** Connection default **
connection default;

--echo '#--------------------FN_DYNVARS_124_01-------------------------#'

########################################################################
# Reveal that a new connect gets counted as "slow launched thread" if  #
# @@GLOBAL.slow_launch_time = 0.                                       #
# The value of slow_launch_threads must be increased by 1.             #
########################################################################

SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;

let $value_before=
   query_get_value(show status like 'slow_launch_threads', Value, 1);
--echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
let $value_after=
   query_get_value(show status like 'slow_launch_threads', Value, 1);
if (!`SELECT $value_after = $value_before + 1`)
{
   --echo ERROR: Subtest FN_DYNVARS_124_01 failed
   --echo A new connect should be counted as 'slow_launch_thread' if
   --echo @@GLOBAL.slow_launch_time=0
   SELECT @@GLOBAL.slow_launch_time;
   echo Number of slow_launch_threads before new connect: $value_before;
   echo Number of slow_launch_threads after new connect: $value_after;
}
--echo ** Switch to connection default and disconnect conn1 **
connection default;
disconnect conn1;

--echo '#--------------------FN_DYNVARS_124_02-------------------------#'

########################################################################
# Reveal that a new connect gets not counted as "slow launched thread" #
# if @@GLOBAL.slow_launch_time is sufficient big.                      #
# The value of slow_launch_threads must not change.                    #
########################################################################

SET @@GLOBAL.slow_launch_time= 1000;
SELECT @@GLOBAL.slow_launch_time;

let $value_before=
   query_get_value(show status like 'slow_launch_threads', Value, 1);
--echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
let $value_after=
   query_get_value(show status like 'slow_launch_threads', Value, 1);
if ($value_after != $value_before)
{
   --echo ERROR: Subtest FN_DYNVARS_124_02 failed
   --echo A new connect must not be counted as 'slow_launch_thread' if
   --echo @@GLOBAL.slow_launch_time is sufficient big.
   SELECT @@GLOBAL.slow_launch_time;
   echo Number of slow_launch_threads before new connect: $value_before;
   echo Number of slow_launch_threads after new connect: $value_after;
}

#
# Cleanup
#

--echo ** Switch to connection default and disconnect conn2 **
connection default;
disconnect conn2;
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;