Debian Codegraph @

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

raw
1 ############## mysql-test\t\max_prepared_stmt_count_basic.test ###############
2 # #
3 # Variable Name: max_prepared_stmt_count #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 16382 #
8 # Range: 0-4194304 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman #
13 # #
14 # Description: Test Cases of Dynamic System Variable max_prepared_stmt_count #
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 #Due to differences in the results, ps-protocol is switched off.
27 --disable_ps_protocol
28
29 --source include/load_sysvars.inc
30
31
32 ########################################################################
33 # START OF max_prepared_stmt_count TESTS #
34 ########################################################################
35
36
37 ###########################################################################
38 # Saving initial value of max_prepared_stmt_count in a temporary variable #
39 ###########################################################################
40
41 SET @start_value = @@global.max_prepared_stmt_count;
42 SELECT @start_value;
43
44
45 --echo '#--------------------FN_DYNVARS_081_01------------------------#'
46 ##########################################################################
47 # Display the DEFAULT value of max_prepared_stmt_count #
48 ##########################################################################
49
50 SET @@global.max_prepared_stmt_count = 5000;
51 SET @@global.max_prepared_stmt_count = DEFAULT;
52 SELECT @@global.max_prepared_stmt_count;
53
54
55 --echo '#---------------------FN_DYNVARS_081_02-------------------------#'
56 ###############################################
57 # Verify default value of variable #
58 ###############################################
59
60 SET @@global.max_prepared_stmt_count = @start_value;
61 SELECT @@global.max_prepared_stmt_count = 16382;
62
63
64 --echo '#--------------------FN_DYNVARS_081_03------------------------#'
65 ##########################################################################
66 # Change the value of max_prepared_stmt_count to a valid value #
67 ##########################################################################
68
69 SET @@global.max_prepared_stmt_count = 0;
70 SELECT @@global.max_prepared_stmt_count;
71 SET @@global.max_prepared_stmt_count = 1;
72 SELECT @@global.max_prepared_stmt_count;
73 SET @@global.max_prepared_stmt_count = 1048576;
74 SELECT @@global.max_prepared_stmt_count;
75 SET @@global.max_prepared_stmt_count = 1048575;
76 SELECT @@global.max_prepared_stmt_count;
77 SET @@global.max_prepared_stmt_count = 65535;
78 SELECT @@global.max_prepared_stmt_count;
79
80
81 --echo '#--------------------FN_DYNVARS_081_04-------------------------#'
82 #############################################################################
83 # Change the value of max_prepared_stmt_count to invalid value #
84 #############################################################################
85
86 SET @@global.max_prepared_stmt_count = -1;
87 SELECT @@global.max_prepared_stmt_count;
88 SET @@global.max_prepared_stmt_count = 100000000000;
89 SELECT @@global.max_prepared_stmt_count;
90 --Error ER_WRONG_TYPE_FOR_VAR
91 SET @@global.max_prepared_stmt_count = 10000.01;
92 SELECT @@global.max_prepared_stmt_count;
93 SET @@global.max_prepared_stmt_count = -1024;
94 SELECT @@global.max_prepared_stmt_count;
95 SET @@global.max_prepared_stmt_count = 1048577;
96 SELECT @@global.max_prepared_stmt_count;
97 SET @@global.max_prepared_stmt_count = 4194304;
98 SELECT @@global.max_prepared_stmt_count;
99 SET @@global.max_prepared_stmt_count = 4194305;
100 SELECT @@global.max_prepared_stmt_count;
101 SET @@global.max_prepared_stmt_count = 104857612;
102 SELECT @@global.max_prepared_stmt_count;
103
104 --Error ER_WRONG_TYPE_FOR_VAR
105 SET @@global.max_prepared_stmt_count = ON;
106 SELECT @@global.max_prepared_stmt_count;
107 --Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.max_prepared_stmt_count = 'test';
109 SELECT @@global.max_prepared_stmt_count;
110 --Error ER_WRONG_TYPE_FOR_VAR
111 SET @@global.max_prepared_stmt_count = ' ';
112 SELECT @@global.max_prepared_stmt_count;
113
114
115 --echo '#-------------------FN_DYNVARS_081_05----------------------------#'
116 #############################################################################
117 # Test if accessing session max_prepared_stmt_count gives error #
118 #############################################################################
119
120 --Error ER_GLOBAL_VARIABLE
121 SET @@session.max_prepared_stmt_count = 4096;
122 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
123 SELECT @@session.max_prepared_stmt_count;
124
125
126 --echo '#----------------------FN_DYNVARS_081_06------------------------#'
127 ##############################################################################
128 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
129 ##############################################################################
130
131 --disable_warnings
132 SELECT @@global.max_prepared_stmt_count = VARIABLE_VALUE
133 FROM performance_schema.global_variables
134 WHERE VARIABLE_NAME='max_prepared_stmt_count';
135
136 SELECT @@max_prepared_stmt_count = VARIABLE_VALUE
137 FROM performance_schema.session_variables
138 WHERE VARIABLE_NAME='max_prepared_stmt_count';
139 --enable_warnings
140
141
142 --echo '#---------------------FN_DYNVARS_081_07----------------------#'
143 ###################################################################
144 # Check if TRUE and FALSE values can be used on variable #
145 ###################################################################
146
147 SET @@global.max_prepared_stmt_count = TRUE;
148 SELECT @@global.max_prepared_stmt_count;
149 SET @@global.max_prepared_stmt_count = FALSE;
150 SELECT @@global.max_prepared_stmt_count;
151
152
153 --echo '#---------------------FN_DYNVARS_081_08----------------------#'
154 ########################################################################################################
155 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
156 ########################################################################################################
157
158 SET @@global.max_prepared_stmt_count = 5000;
159 SELECT @@max_prepared_stmt_count = @@global.max_prepared_stmt_count;
160
161
162 --echo '#---------------------FN_DYNVARS_081_09----------------------#'
163 ################################################################################
164 # Check if max_prepared_stmt_count can be accessed with and without @@ sign #
165 ################################################################################
166
167 --Error ER_GLOBAL_VARIABLE
168 SET max_prepared_stmt_count = 6000;
169 SELECT @@max_prepared_stmt_count;
170 --Error ER_PARSE_ERROR
171 SET local.max_prepared_stmt_count = 7000;
172 --Error ER_UNKNOWN_TABLE
173 SELECT local.max_prepared_stmt_count;
174 --Error ER_PARSE_ERROR
175 SET global.max_prepared_stmt_count = 8000;
176 --Error ER_UNKNOWN_TABLE
177 SELECT global.max_prepared_stmt_count;
178 --Error ER_BAD_FIELD_ERROR
179 SELECT max_prepared_stmt_count;
180 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
181 SELECT @@session.max_prepared_stmt_count;
182
183
184 ##############################
185 # Restore initial value #
186 ##############################
187
188 SET @@global.max_prepared_stmt_count = @start_value;
189 SELECT @@global.max_prepared_stmt_count;
190
191 --enable_ps_protocol
192 ########################################################################
193 # END OF max_prepared_stmt_count TESTS #
194 ########################################################################