1 ############## mysql-test\t\transaction_prealloc_size_basic.test ##############
3 # Variable Name: transaction_prealloc_size #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
7 # Default Value: 4096 #
11 # Creation Date: 2008-02-14 #
12 # Author: Sharique Abdullah #
14 # Description: Test Cases of Dynamic System Variable transaction_prealloc_size#
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#option_mysqld_transaction_prealloc_size #
24 ###############################################################################
26 --source include/load_sysvars.inc
28 ########################################################################
29 # START OF transaction_prealloc_size TESTS #
30 ########################################################################
33 #############################################################
34 # Save initial value #
35 #############################################################
37 SET @start_global_value = @@global.transaction_prealloc_size;
38 SELECT @start_global_value;
39 SET @start_session_value = @@session.transaction_prealloc_size;
40 SELECT @start_session_value;
42 --echo
'#--------------------FN_DYNVARS_005_01-------------------------#'
43 ########################################################################
44 # Display the DEFAULT value of transaction_prealloc_size #
45 ########################################################################
47 SET @@global.transaction_prealloc_size = 100;
48 SET @@global.transaction_prealloc_size = DEFAULT;
49 SELECT @@global.transaction_prealloc_size;
52 SET @@session.transaction_prealloc_size = 200;
53 SET @@session.transaction_prealloc_size = DEFAULT;
54 SELECT @@session.transaction_prealloc_size;
56 --echo
'#--------------------FN_DYNVARS_005_02-------------------------#'
57 ########################################################################
58 # Check the DEFAULT value of transaction_prealloc_size #
59 ########################################################################
61 SET @@global.transaction_prealloc_size = DEFAULT;
62 SELECT @@global.transaction_prealloc_size = 4096;
64 SET @@session.transaction_prealloc_size = DEFAULT;
65 SELECT @@session.transaction_prealloc_size = 4096;
67 --echo
'#--------------------FN_DYNVARS_005_03-------------------------#'
68 ##################################################################
69 # Change the value of variable to a valid value for GLOBAL Scope #
70 ##################################################################
72 SET @@global.transaction_prealloc_size = 1024;
73 SELECT @@global.transaction_prealloc_size;
75 SET @@global.transaction_prealloc_size = 60020;
76 SELECT @@global.transaction_prealloc_size;
78 SET @@global.transaction_prealloc_size = 4294966272;
79 SELECT @@global.transaction_prealloc_size;
82 --echo
'#--------------------FN_DYNVARS_005_04-------------------------#'
83 ###################################################################
84 # Change the value of variable to a valid value for SESSION Scope #
85 ###################################################################
87 SET @@session.transaction_prealloc_size = 1024;
88 SELECT @@session.transaction_prealloc_size;
90 SET @@session.transaction_prealloc_size =4294966272;
91 SELECT @@session.transaction_prealloc_size;
92 SET @@session.transaction_prealloc_size = 65535;
93 SELECT @@session.transaction_prealloc_size;
96 --echo
'#------------------FN_DYNVARS_005_05-----------------------#'
97 #####################################################################
98 # Change the value of transaction_prealloc_size to an invalid value #
99 #####################################################################
101 SET @@global.transaction_prealloc_size = 0;
102 SELECT @@global.transaction_prealloc_size;
104 SET @@global.transaction_prealloc_size = -1024;
105 SELECT @@global.transaction_prealloc_size;
107 -- Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.transaction_prealloc_size = ON;
111 -- Error ER_WRONG_TYPE_FOR_VAR
112 SET @@global.transaction_prealloc_size = OFF;
115 SET @@global.transaction_prealloc_size =
True;
116 SELECT @@global.transaction_prealloc_size;
118 SET @@global.transaction_prealloc_size = False;
119 SELECT @@global.transaction_prealloc_size;
122 -- Error ER_WRONG_TYPE_FOR_VAR
123 SET @@global.transaction_prealloc_size = 65530.34;
125 -- Error ER_WRONG_TYPE_FOR_VAR
126 SET @@global.transaction_prealloc_size =
"Test";
128 SET @@global.transaction_prealloc_size = 1000;
129 SELECT @@global.transaction_prealloc_size;
131 -- Error ER_WRONG_TYPE_FOR_VAR
132 SET @@session.transaction_prealloc_size = ON;
135 -- Error ER_WRONG_TYPE_FOR_VAR
136 SET @@session.transaction_prealloc_size = OFF;
138 SET @@session.transaction_prealloc_size =
True;
139 SELECT @@session.transaction_prealloc_size;
141 SET @@session.transaction_prealloc_size = False;
142 SELECT @@session.transaction_prealloc_size;
144 --Error ER_WRONG_TYPE_FOR_VAR
145 SET @@session.transaction_prealloc_size =
"Test";
147 SET @@session.transaction_prealloc_size = 123456789031;
148 SELECT @@session.transaction_prealloc_size;
151 --echo
'#------------------FN_DYNVARS_005_06-----------------------#'
152 ####################################################################
153 # Check if the value in GLOBAL Table matches value in variable #
154 ####################################################################
157 SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
158 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
159 WHERE VARIABLE_NAME=
'transaction_prealloc_size';
161 --echo
'#------------------FN_DYNVARS_005_07-----------------------#'
162 ####################################################################
163 # Check if the value in SESSION Table matches value in variable #
164 ####################################################################
166 SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE
167 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
168 WHERE VARIABLE_NAME=
'transaction_prealloc_size';
173 --echo
'#---------------------FN_DYNVARS_001_09----------------------#'
174 ###########################################################################
175 # Check if global and session variable are independent of each other #
176 ###########################################################################
178 SET @@global.transaction_prealloc_size = 1024;
179 SET @@global.transaction_prealloc_size = 10;
181 SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
184 --echo
'#---------------------FN_DYNVARS_001_10----------------------#'
185 ########################################################################
186 # Check if accessing variable with SESSION,LOCAL and without SCOPE #
187 # points to same session variable #
188 ########################################################################
190 SET @@transaction_prealloc_size = 100;
191 SELECT @@transaction_prealloc_size = @@local.transaction_prealloc_size;
192 SELECT @@local.transaction_prealloc_size = @@session.transaction_prealloc_size;
195 --echo
'#---------------------FN_DYNVARS_001_11----------------------#'
196 ###############################################################################
197 # Check if transaction_prealloc_size can be accessed with and without @@ sign #
198 ###############################################################################
200 SET transaction_prealloc_size = 1027;
201 SELECT @@transaction_prealloc_size;
203 --Error ER_UNKNOWN_TABLE
204 SELECT local.transaction_prealloc_size;
206 --Error ER_UNKNOWN_TABLE
207 SELECT session.transaction_prealloc_size;
209 --Error ER_BAD_FIELD_ERROR
210 SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
212 ####################################
213 # Restore initial value #
214 ####################################
216 SET @@global.transaction_prealloc_size = @start_global_value;
217 SELECT @@global.transaction_prealloc_size;
218 SET @@session.transaction_prealloc_size = @start_session_value;
219 SELECT @@session.transaction_prealloc_size;
222 #############################################################
223 # END OF transaction_prealloc_size TESTS #
224 #############################################################