1 ############## mysql-test\t\min_examined_row_limit_basic.test ###############
3 # Variable Name: min_examined_row_limit #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
11 # Creation Date: 2008-02-07 #
14 # Description: Test Cases of Dynamic System Variable min_examined_row_limit #
15 # that checks the behavior of this variable in the following ways#
17 # * Valid & Invalid values #
18 # * Scope & Access method #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-system-variables.html #
24 ###############################################################################
26 --source include/load_sysvars.inc
28 ######################################################################
29 # START OF min_examined_row_limit TESTS #
30 ######################################################################
33 #############################################################
34 # Save initial value #
35 #############################################################
37 SET @start_global_value = @@global.min_examined_row_limit;
38 SELECT @start_global_value;
39 SET @start_session_value = @@session.min_examined_row_limit;
40 SELECT @start_session_value;
43 --echo
'#--------------------FN_DYNVARS_089_01-------------------------#'
44 ######################################################################
45 # Display the DEFAULT value of min_examined_row_limit #
46 ######################################################################
48 SET @@global.min_examined_row_limit = 100;
49 SET @@global.min_examined_row_limit = DEFAULT;
50 SELECT @@global.min_examined_row_limit;
52 SET @@session.min_examined_row_limit = 200;
53 SET @@session.min_examined_row_limit = DEFAULT;
54 SELECT @@session.min_examined_row_limit;
57 --echo
'#--------------------FN_DYNVARS_089_02-------------------------#'
58 ########################################################################
59 # Check the DEFAULT value of min_examined_row_limit #
60 ########################################################################
62 SET @@global.min_examined_row_limit = DEFAULT;
63 SELECT @@global.min_examined_row_limit = 0;
65 SET @@session.min_examined_row_limit = DEFAULT;
66 SELECT @@session.min_examined_row_limit = 0;
69 --echo
'#--------------------FN_DYNVARS_089_03-------------------------#'
70 ################################################################################
71 # Change the value of min_examined_row_limit to a valid value for GLOBAL Scope #
72 ################################################################################
74 SET @@global.min_examined_row_limit = 0;
75 SELECT @@global.min_examined_row_limit;
76 SET @@global.min_examined_row_limit = 1;
77 SELECT @@global.min_examined_row_limit;
78 SET @@global.min_examined_row_limit = 60020;
79 SELECT @@global.min_examined_row_limit;
80 SET @@global.min_examined_row_limit = 65535;
81 SELECT @@global.min_examined_row_limit;
82 SET @@global.min_examined_row_limit = 4294967295;
83 SELECT @@global.min_examined_row_limit;
84 SET @@global.min_examined_row_limit = 4294967294;
85 SELECT @@global.min_examined_row_limit;
89 --echo
'#--------------------FN_DYNVARS_089_04-------------------------#'
90 ###################################################################################
91 # Change the value of min_examined_row_limit to a valid value for SESSION Scope #
92 ###################################################################################
94 SET @@session.min_examined_row_limit = 0;
95 SELECT @@session.min_examined_row_limit;
96 SET @@session.min_examined_row_limit = 1;
97 SELECT @@session.min_examined_row_limit;
98 SET @@session.min_examined_row_limit = 50050;
99 SELECT @@session.min_examined_row_limit;
100 SET @@session.min_examined_row_limit = 65535;
101 SELECT @@session.min_examined_row_limit;
102 SET @@session.min_examined_row_limit = 4294967295;
103 SELECT @@session.min_examined_row_limit;
104 SET @@session.min_examined_row_limit = 4294967294;
105 SELECT @@session.min_examined_row_limit;
108 --echo
'#------------------FN_DYNVARS_089_05-----------------------#'
109 ####################################################################
110 # Change the value of min_examined_row_limit to an invalid value #
111 ####################################################################
113 SET @@global.min_examined_row_limit = 429496726;
114 SELECT @@global.min_examined_row_limit;
115 SET @@global.min_examined_row_limit = -1024;
116 SELECT @@global.min_examined_row_limit;
117 SET @@global.min_examined_row_limit = 429496729500;
118 SELECT @@global.min_examined_row_limit;
119 --Error ER_WRONG_TYPE_FOR_VAR
120 SET @@global.min_examined_row_limit = 65530.34;
121 SELECT @@global.min_examined_row_limit;
122 --Error ER_WRONG_TYPE_FOR_VAR
123 SET @@global.min_examined_row_limit =
test;
124 SELECT @@global.min_examined_row_limit;
126 SET @@session.min_examined_row_limit = 4294967296;
127 SELECT @@session.min_examined_row_limit;
128 SET @@session.min_examined_row_limit = -1;
129 SELECT @@session.min_examined_row_limit;
130 --Error ER_WRONG_TYPE_FOR_VAR
131 SET @@session.min_examined_row_limit = 65530.34;
132 SET @@session.min_examined_row_limit = 4294967295021;
133 SELECT @@session.min_examined_row_limit;
135 --Error ER_WRONG_TYPE_FOR_VAR
136 SET @@session.min_examined_row_limit =
test;
137 SELECT @@session.min_examined_row_limit;
140 --echo
'#------------------FN_DYNVARS_089_06-----------------------#'
141 ####################################################################
142 # Check if the value in GLOBAL Table matches value in variable #
143 ####################################################################
146 SELECT @@global.min_examined_row_limit = VARIABLE_VALUE
147 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
148 WHERE VARIABLE_NAME=
'min_examined_row_limit';
150 --echo
'#------------------FN_DYNVARS_089_07-----------------------#'
151 ####################################################################
152 # Check if the value in SESSION Table matches value in variable #
153 ####################################################################
155 SELECT @@session.min_examined_row_limit = VARIABLE_VALUE
156 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
157 WHERE VARIABLE_NAME=
'min_examined_row_limit';
160 --echo
'#------------------FN_DYNVARS_089_08-----------------------#'
161 ####################################################################
162 # Check if TRUE and FALSE values can be used on variable #
163 ####################################################################
165 SET @@global.min_examined_row_limit = TRUE;
166 SELECT @@global.min_examined_row_limit;
167 SET @@global.min_examined_row_limit = FALSE;
168 SELECT @@global.min_examined_row_limit;
171 --echo
'#---------------------FN_DYNVARS_089_09----------------------#'
172 ####################################################################################
173 # Check if accessing variable with and without GLOBAL point to same variable #
174 ####################################################################################
176 SET @@global.min_examined_row_limit = 10;
177 SELECT @@min_examined_row_limit = @@global.min_examined_row_limit;
180 --echo
'#---------------------FN_DYNVARS_089_10----------------------#'
181 ########################################################################################################
182 # Check if accessing variable with SESSION,LOCAL and without SCOPE points to same session variable #
183 ########################################################################################################
185 SET @@min_examined_row_limit = 100;
186 SELECT @@min_examined_row_limit = @@local.min_examined_row_limit;
187 SELECT @@local.min_examined_row_limit = @@session.min_examined_row_limit;
190 --echo
'#---------------------FN_DYNVARS_089_11----------------------#'
191 ###################################################################################
192 # Check if min_examined_row_limit can be accessed with and without @@ sign #
193 ###################################################################################
195 SET min_examined_row_limit = 1;
196 SELECT @@min_examined_row_limit;
197 --Error ER_UNKNOWN_TABLE
198 SELECT local.min_examined_row_limit;
199 --Error ER_UNKNOWN_TABLE
200 SELECT session.min_examined_row_limit;
201 --Error ER_BAD_FIELD_ERROR
202 SELECT min_examined_row_limit = @@session.min_examined_row_limit;
205 ####################################
206 # Restore initial value #
207 ####################################
209 SET @@global.min_examined_row_limit = @start_global_value;
210 SELECT @@global.min_examined_row_limit;
211 SET @@session.min_examined_row_limit = @start_session_value;
212 SELECT @@session.min_examined_row_limit;
215 #############################################################
216 # END OF min_examined_row_limit TESTS #
217 #############################################################