MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
transaction_prealloc_size_basic.inc
1 ############## mysql-test\t\transaction_prealloc_size_basic.test ##############
2 # #
3 # Variable Name: transaction_prealloc_size #
4 # Scope: GLOBAL | SESSION #
5 # Access Type: Dynamic #
6 # Data Type: numeric #
7 # Default Value: 4096 #
8 # Range: #
9 # #
10 # #
11 # Creation Date: 2008-02-14 #
12 # Author: Sharique Abdullah #
13 # #
14 # Description: Test Cases of Dynamic System Variable transaction_prealloc_size#
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#option_mysqld_transaction_prealloc_size #
23 # #
24 ###############################################################################
25 
26 --source include/load_sysvars.inc
27 
28 ########################################################################
29 # START OF transaction_prealloc_size TESTS #
30 ########################################################################
31 
32 
33 #############################################################
34 # Save initial value #
35 #############################################################
36 
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;
41 
42 --echo '#--------------------FN_DYNVARS_005_01-------------------------#'
43 ########################################################################
44 # Display the DEFAULT value of transaction_prealloc_size #
45 ########################################################################
46 
47 SET @@global.transaction_prealloc_size = 100;
48 SET @@global.transaction_prealloc_size = DEFAULT;
49 SELECT @@global.transaction_prealloc_size;
50 
51 
52 SET @@session.transaction_prealloc_size = 200;
53 SET @@session.transaction_prealloc_size = DEFAULT;
54 SELECT @@session.transaction_prealloc_size;
55 
56 --echo '#--------------------FN_DYNVARS_005_02-------------------------#'
57 ########################################################################
58 # Check the DEFAULT value of transaction_prealloc_size #
59 ########################################################################
60 
61 SET @@global.transaction_prealloc_size = DEFAULT;
62 SELECT @@global.transaction_prealloc_size = 4096;
63 
64 SET @@session.transaction_prealloc_size = DEFAULT;
65 SELECT @@session.transaction_prealloc_size = 4096;
66 
67 --echo '#--------------------FN_DYNVARS_005_03-------------------------#'
68 ##################################################################
69 # Change the value of variable to a valid value for GLOBAL Scope #
70 ##################################################################
71 
72 SET @@global.transaction_prealloc_size = 1024;
73 SELECT @@global.transaction_prealloc_size;
74 
75 SET @@global.transaction_prealloc_size = 60020;
76 SELECT @@global.transaction_prealloc_size;
77 
78 SET @@global.transaction_prealloc_size = 4294966272;
79 SELECT @@global.transaction_prealloc_size;
80 
81 
82 --echo '#--------------------FN_DYNVARS_005_04-------------------------#'
83 ###################################################################
84 # Change the value of variable to a valid value for SESSION Scope #
85 ###################################################################
86 
87 SET @@session.transaction_prealloc_size = 1024;
88 SELECT @@session.transaction_prealloc_size;
89 
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;
94 
95 
96 --echo '#------------------FN_DYNVARS_005_05-----------------------#'
97 #####################################################################
98 # Change the value of transaction_prealloc_size to an invalid value #
99 #####################################################################
100 
101 SET @@global.transaction_prealloc_size = 0;
102 SELECT @@global.transaction_prealloc_size;
103 
104 SET @@global.transaction_prealloc_size = -1024;
105 SELECT @@global.transaction_prealloc_size;
106 
107 -- Error ER_WRONG_TYPE_FOR_VAR
108 SET @@global.transaction_prealloc_size = ON;
109 
110 
111 -- Error ER_WRONG_TYPE_FOR_VAR
112 SET @@global.transaction_prealloc_size = OFF;
113 
114 
115 SET @@global.transaction_prealloc_size = True;
116 SELECT @@global.transaction_prealloc_size;
117 
118 SET @@global.transaction_prealloc_size = False;
119 SELECT @@global.transaction_prealloc_size;
120 
121 
122 -- Error ER_WRONG_TYPE_FOR_VAR
123 SET @@global.transaction_prealloc_size = 65530.34;
124 
125 -- Error ER_WRONG_TYPE_FOR_VAR
126 SET @@global.transaction_prealloc_size ="Test";
127 
128 SET @@global.transaction_prealloc_size = 1000;
129 SELECT @@global.transaction_prealloc_size;
130 
131 -- Error ER_WRONG_TYPE_FOR_VAR
132 SET @@session.transaction_prealloc_size = ON;
133 
134 
135 -- Error ER_WRONG_TYPE_FOR_VAR
136 SET @@session.transaction_prealloc_size = OFF;
137 
138 SET @@session.transaction_prealloc_size = True;
139 SELECT @@session.transaction_prealloc_size;
140 
141 SET @@session.transaction_prealloc_size = False;
142 SELECT @@session.transaction_prealloc_size;
143 
144 --Error ER_WRONG_TYPE_FOR_VAR
145 SET @@session.transaction_prealloc_size = "Test";
146 
147 SET @@session.transaction_prealloc_size = 123456789031;
148 SELECT @@session.transaction_prealloc_size;
149 
150 
151 --echo '#------------------FN_DYNVARS_005_06-----------------------#'
152 ####################################################################
153 # Check if the value in GLOBAL Table matches value in variable #
154 ####################################################################
155 
156 
157 SELECT @@global.transaction_prealloc_size = VARIABLE_VALUE
158 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
159 WHERE VARIABLE_NAME='transaction_prealloc_size';
160 
161 --echo '#------------------FN_DYNVARS_005_07-----------------------#'
162 ####################################################################
163 # Check if the value in SESSION Table matches value in variable #
164 ####################################################################
165 
166 SELECT @@session.transaction_prealloc_size = VARIABLE_VALUE
167 FROM INFORMATION_SCHEMA.SESSION_VARIABLES
168 WHERE VARIABLE_NAME='transaction_prealloc_size';
169 
170 
171 
172 
173 --echo '#---------------------FN_DYNVARS_001_09----------------------#'
174 ###########################################################################
175 # Check if global and session variable are independent of each other #
176 ###########################################################################
177 
178 SET @@global.transaction_prealloc_size = 1024;
179 SET @@global.transaction_prealloc_size = 10;
180 
181 SELECT @@transaction_prealloc_size = @@global.transaction_prealloc_size;
182 
183 
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 ########################################################################
189 
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;
193 
194 
195 --echo '#---------------------FN_DYNVARS_001_11----------------------#'
196 ###############################################################################
197 # Check if transaction_prealloc_size can be accessed with and without @@ sign #
198 ###############################################################################
199 
200 SET transaction_prealloc_size = 1027;
201 SELECT @@transaction_prealloc_size;
202 
203 --Error ER_UNKNOWN_TABLE
204 SELECT local.transaction_prealloc_size;
205 
206 --Error ER_UNKNOWN_TABLE
207 SELECT session.transaction_prealloc_size;
208 
209 --Error ER_BAD_FIELD_ERROR
210 SELECT transaction_prealloc_size = @@session.transaction_prealloc_size;
211 
212 ####################################
213 # Restore initial value #
214 ####################################
215 
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;
220 
221 
222 #############################################################
223 # END OF transaction_prealloc_size TESTS #
224 #############################################################
225