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-1048576 #
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 = 4294967296;
96 SELECT @@global.max_prepared_stmt_count;
97 SET @@global.max_prepared_stmt_count = 4294967295*1024;
98 SELECT @@global.max_prepared_stmt_count;
99
100 --Error ER_WRONG_TYPE_FOR_VAR
101 SET @@global.max_prepared_stmt_count = ON;
102 SELECT @@global.max_prepared_stmt_count;
103 --Error ER_WRONG_TYPE_FOR_VAR
104 SET @@global.max_prepared_stmt_count = 'test';
105 SELECT @@global.max_prepared_stmt_count;
106
107
108 --echo '#-------------------FN_DYNVARS_081_05----------------------------#'
109 #############################################################################
110 # Test if accessing session max_prepared_stmt_count gives error #
111 #############################################################################
112
113 --Error ER_GLOBAL_VARIABLE
114 SET @@session.max_prepared_stmt_count = 4096;
115 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
116 SELECT @@session.max_prepared_stmt_count;
117
118
119 --echo '#----------------------FN_DYNVARS_081_06------------------------#'
120 ##############################################################################
121 # Check if the value in GLOBAL & SESSION Tables matches values in variable #
122 ##############################################################################
123
124 SELECT @@global.max_prepared_stmt_count = VARIABLE_VALUE
125 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
126 WHERE VARIABLE_NAME='max_prepared_stmt_count';
127
128 SELECT @@max_prepared_stmt_count = VARIABLE_VALUE
129 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
130 WHERE VARIABLE_NAME='max_prepared_stmt_count';
131
132
133 --echo '#---------------------FN_DYNVARS_081_07----------------------#'
134 ###################################################################
135 # Check if TRUE and FALSE values can be used on variable #
136 ###################################################################
137
138 SET @@global.max_prepared_stmt_count = TRUE;
139 SELECT @@global.max_prepared_stmt_count;
140 SET @@global.max_prepared_stmt_count = FALSE;
141 SELECT @@global.max_prepared_stmt_count;
142
143
144 --echo '#---------------------FN_DYNVARS_081_08----------------------#'
145 ########################################################################################################
146 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
147 ########################################################################################################
148
149 SET @@global.max_prepared_stmt_count = 5000;
150 SELECT @@max_prepared_stmt_count = @@global.max_prepared_stmt_count;
151
152
153 --echo '#---------------------FN_DYNVARS_081_09----------------------#'
154 ################################################################################
155 # Check if max_prepared_stmt_count can be accessed with and without @@ sign #
156 ################################################################################
157
158 --Error ER_GLOBAL_VARIABLE
159 SET max_prepared_stmt_count = 6000;
160 SELECT @@max_prepared_stmt_count;
161 --Error ER_UNKNOWN_TABLE
162 SELECT local.max_prepared_stmt_count;
163 --Error ER_UNKNOWN_TABLE
164 SELECT global.max_prepared_stmt_count;
165 --Error ER_BAD_FIELD_ERROR
166 SELECT max_prepared_stmt_count = @@session.max_prepared_stmt_count;
167
168
169 ##############################
170 # Restore initial value #
171 ##############################
172
173 SET @@global.max_prepared_stmt_count = @start_value;
174 SELECT @@global.max_prepared_stmt_count;
175
176 --enable_ps_protocol
177 ########################################################################
178 # END OF max_prepared_stmt_count TESTS #
179 ########################################################################