Debian Codegraph @

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

raw
1 ################# mysql-test\t\innodb_thread_concurrency_basic.test ###########
2 # #
3 # Variable Name: innodb_thread_concurrency #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: Numeric #
7 # Default Value: 0 #
8 # Range: 0-1000 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Rizwan #
13 # #
14 #Description:Test Cases of Dynamic System Variable innodb_thread_concurrency #
15 # that checks the behavior of this variable in the following ways #
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Data Integrity #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-system-variables.html #
23 # #
24 ###############################################################################
25
26 --source include/load_sysvars.inc
27
28 ########################################################################
29 # START OF innodb_thread_concurrency TESTS #
30 ########################################################################
31
32
33 ################################################################################
34 # Saving initial value of innodb_thread_concurrency in a temporary variable #
35 ################################################################################
36
37
38 SET @global_start_value = @@global.innodb_thread_concurrency;
39 SELECT @global_start_value;
40 SET @default_innodb_thread_sleep_delay = @@global.innodb_thread_sleep_delay;
41
42
43
44 --echo '#--------------------FN_DYNVARS_046_01------------------------#'
45 ########################################################################
46 # Display the DEFAULT value of innodb_thread_concurrency #
47 ########################################################################
48
49
50
51 SET @@global.innodb_thread_concurrency = 0;
52 SET @@global.innodb_thread_concurrency = DEFAULT;
53 SELECT @@global.innodb_thread_concurrency;
54
55 --echo '#---------------------FN_DYNVARS_046_02-------------------------#'
56 ###############################################################################
57 # Check if innodb_thread_concurrency can be accessed with and without @@ sign #
58 ###############################################################################
59
60 --Error ER_GLOBAL_VARIABLE
61 SET innodb_thread_concurrency = 1;
62 SELECT @@innodb_thread_concurrency;
63
64
65 --Error ER_UNKNOWN_TABLE
66 SELECT local.innodb_thread_concurrency;
67
68
69 SET global innodb_thread_concurrency = 0;
70 SELECT @@global.innodb_thread_concurrency;
71
72
73 --echo '#--------------------FN_DYNVARS_046_03------------------------#'
74 ##########################################################################
75 # change the value of innodb_thread_concurrency to a valid value #
76 ##########################################################################
77
78
79 SET @@global.innodb_thread_concurrency = 0;
80 SELECT @@global.innodb_thread_concurrency;
81
82 SET @@global.innodb_thread_concurrency = 1;
83 SELECT @@global.innodb_thread_concurrency;
84 SET @@global.innodb_thread_concurrency = 1000;
85 SELECT @@global.innodb_thread_concurrency;
86
87 --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
88 ###########################################################################
89 # Change the value of innodb_thread_concurrency to invalid value #
90 ###########################################################################
91
92 SET @@global.innodb_thread_concurrency = -1;
93 SELECT @@global.innodb_thread_concurrency;
94
95 --Error ER_WRONG_TYPE_FOR_VAR
96 SET @@global.innodb_thread_concurrency = "T";
97 SELECT @@global.innodb_thread_concurrency;
98
99 --Error ER_WRONG_TYPE_FOR_VAR
100 SET @@global.innodb_thread_concurrency = "Y";
101 SELECT @@global.innodb_thread_concurrency;
102 --Error ER_WRONG_TYPE_FOR_VAR
103 SET @@global.innodb_thread_concurrency = ' ';
104 SELECT @@global.innodb_thread_concurrency;
105 --Error ER_WRONG_TYPE_FOR_VAR
106 SET @@global.innodb_thread_concurrency = " ";
107 SELECT @@global.innodb_thread_concurrency;
108
109 SET @@global.innodb_thread_concurrency = 1001;
110 SELECT @@global.innodb_thread_concurrency;
111
112 --Error ER_WRONG_TYPE_FOR_VAR
113 SET @@global.innodb_thread_concurrency = 255.01;
114 SELECT @@global.innodb_thread_concurrency;
115
116 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
117 #########################################################################
118 # Check if the value in GLOBAL Table matches value in variable #
119 #########################################################################
120
121 --disable_warnings
122 SELECT @@global.innodb_thread_concurrency =
123 VARIABLE_VALUE FROM performance_schema.global_variables
124 WHERE VARIABLE_NAME='innodb_thread_concurrency';
125 --enable_warnings
126 SELECT @@global.innodb_thread_concurrency;
127 --disable_warnings
128 SELECT VARIABLE_VALUE FROM performance_schema.global_variables
129 WHERE VARIABLE_NAME='innodb_thread_concurrency';
130 --enable_warnings
131
132 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
133 ###################################################################
134 # Check if ON and OFF values can be used on variable #
135 ###################################################################
136
137 --ERROR ER_WRONG_TYPE_FOR_VAR
138 SET @@global.innodb_thread_concurrency = OFF;
139 SELECT @@global.innodb_thread_concurrency;
140
141 --ERROR ER_WRONG_TYPE_FOR_VAR
142 SET @@global.innodb_thread_concurrency = ON;
143 SELECT @@global.innodb_thread_concurrency;
144
145 --echo '#---------------------FN_DYNVARS_046_07----------------------#'
146 ###################################################################
147 # Check if TRUE and FALSE values can be used on variable #
148 ###################################################################
149
150 SET @@global.innodb_thread_concurrency = TRUE;
151 SELECT @@global.innodb_thread_concurrency;
152 SET @@global.innodb_thread_concurrency = FALSE;
153 SELECT @@global.innodb_thread_concurrency;
154
155 ##############################
156 # Restore initial value #
157 ##############################
158
159 SET @@global.innodb_thread_concurrency = @global_start_value;
160 SELECT @@global.innodb_thread_concurrency;
161
162 # Set innodb_thread_sleep_delay back to the default value
163 # because it gets halved when slots are free and there
164 # are no waiting threads sleeping.
165 SET @@global.innodb_thread_sleep_delay = @default_innodb_thread_sleep_delay;
166
167 ###############################################################
168 # END OF innodb_thread_concurrency TESTS #
169 ###############################################################