~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/t/query_prealloc_size_basic.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
################# mysql-test\t\query_prealloc_size_basic.test ##################
 
2
#                                                                              #
 
3
# Variable Name: query_prealloc_size                                           #
 
4
# Scope: GLOBAL | SESSION                                                      #
 
5
# Access Type: Dynamic                                                         #
 
6
# Data Type: numeric                                                           #
 
7
# Default Value:  8192                                                         #
 
8
# Range:  8192-4294967295                                                      #
 
9
#                                                                              #
 
10
#                                                                              #
 
11
# Creation Date: 2008-02-07                                                    #
 
12
# Author:  Rizwan                                                              #
 
13
#                                                                              #
 
14
# Description: Test Cases of Dynamic System Variable query_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:                                                                   #
 
22
#      http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html     #
 
23
#                                                                              #
 
24
################################################################################
 
25
 
 
26
--source include/load_sysvars.inc
 
27
 
 
28
########################################################################
 
29
#              START OF query_prealloc_size   TESTS                    #
 
30
########################################################################
 
31
 
 
32
 
 
33
#############################################################
 
34
#                 Save initial value                        #
 
35
#############################################################
 
36
 
 
37
SET @start_global_value = @@global.query_prealloc_size ;
 
38
SELECT @start_global_value;
 
39
SET @start_session_value = @@session.query_prealloc_size ;
 
40
SELECT @start_session_value;
 
41
 
 
42
 
 
43
--echo '#--------------------FN_DYNVARS_005_01-------------------------#'
 
44
########################################################################
 
45
#            Display the DEFAULT value of myisam_block_size            #
 
46
########################################################################
 
47
 
 
48
SET @@global.query_prealloc_size   = 100;
 
49
SET @@global.query_prealloc_size   = DEFAULT;
 
50
SELECT @@global.query_prealloc_size  ;
 
51
 
 
52
SET @@session.query_prealloc_size   = 200;
 
53
SET @@session.query_prealloc_size   = DEFAULT;
 
54
SELECT @@session.query_prealloc_size  ;
 
55
 
 
56
 
 
57
--echo '#--------------------FN_DYNVARS_005_02-------------------------#'
 
58
########################################################################
 
59
#        Check the DEFAULT value of query_prealloc_size                #
 
60
########################################################################
 
61
 
 
62
SET @@global.query_prealloc_size   = DEFAULT;
 
63
SELECT @@global.query_prealloc_size   = 8192;
 
64
 
 
65
SET @@session.query_prealloc_size   = DEFAULT;
 
66
SELECT @@session.query_prealloc_size   = 8192;
 
67
 
 
68
 
 
69
--echo '#--------------------FN_DYNVARS_005_03-------------------------#'
 
70
################################################################################
 
71
# Change the value of query_prealloc_size   to a valid value for GLOBAL Scope  #
 
72
################################################################################
 
73
 
 
74
SET @@global.query_prealloc_size   = 8192;
 
75
SELECT @@global.query_prealloc_size  ;
 
76
 
 
77
#SET @@global.query_prealloc_size   = 4294967295;
 
78
#SELECT @@global.query_prealloc_size  ;
 
79
 
 
80
SET @@global.query_prealloc_size   = 655354;
 
81
SELECT @@global.query_prealloc_size  ;
 
82
 
 
83
 
 
84
--echo '#--------------------FN_DYNVARS_005_04-------------------------#'
 
85
##################################################################################
 
86
# Change the value of query_prealloc_size   to a valid value for SESSION Scope   #
 
87
##################################################################################
 
88
 
 
89
SET @@session.query_prealloc_size   = 8192;
 
90
SELECT @@session.query_prealloc_size  ;
 
91
 
 
92
#SET @@session.query_prealloc_size   = 4294967295;
 
93
#SELECT @@session.query_prealloc_size  ;
 
94
 
 
95
SET @@session.query_prealloc_size   = 655345;
 
96
SELECT @@session.query_prealloc_size  ;
 
97
 
 
98
 
 
99
 
 
100
 
 
101
--echo '#------------------FN_DYNVARS_005_05-----------------------#'
 
102
####################################################################
 
103
#  Change the value of query_prealloc_size   to an invalid value   #
 
104
####################################################################
 
105
 
 
106
SET @@global.query_prealloc_size   = 0;
 
107
SELECT @@global.query_prealloc_size  ;
 
108
 
 
109
#SET @@global.query_prealloc_size   = -1024;
 
110
#SELECT @@global.query_prealloc_size  ;
 
111
 
 
112
#SET @@global.query_prealloc_size   = 429496729533;
 
113
#SELECT @@global.query_prealloc_size  ;
 
114
 
 
115
 
 
116
--Error ER_WRONG_TYPE_FOR_VAR
 
117
SET @@global.query_prealloc_size   = 65530.34;
 
118
SELECT @@global.query_prealloc_size  ;
 
119
 
 
120
--Error ER_WRONG_TYPE_FOR_VAR
 
121
SET @@global.query_prealloc_size   = test;
 
122
SELECT @@global.query_prealloc_size  ;
 
123
 
 
124
--Error ER_WRONG_TYPE_FOR_VAR
 
125
SET @@global.query_prealloc_size   = "test";
 
126
SELECT @@global.query_prealloc_size  ;
 
127
 
 
128
--Error ER_WRONG_TYPE_FOR_VAR
 
129
SET @@global.query_prealloc_size   = 'test';
 
130
SELECT @@global.query_prealloc_size  ;
 
131
 
 
132
--Error ER_WRONG_TYPE_FOR_VAR
 
133
SET @@global.query_prealloc_size   = ON;
 
134
SELECT @@global.query_prealloc_size  ;
 
135
 
 
136
 
 
137
SET @@session.query_prealloc_size   = 0;
 
138
SELECT @@session.query_prealloc_size  ;
 
139
 
 
140
#SET @@session.query_prealloc_size   = -2;
 
141
#SELECT @@session.query_prealloc_size  ;
 
142
 
 
143
--Error  ER_WRONG_TYPE_FOR_VAR
 
144
SET @@session.query_prealloc_size   = 65530.34;
 
145
SELECT @@session.query_prealloc_size  ;
 
146
 
 
147
 
 
148
--Error ER_WRONG_TYPE_FOR_VAR
 
149
SET @@session.query_prealloc_size   = test;
 
150
SELECT @@session.query_prealloc_size  ;
 
151
 
 
152
--Error ER_WRONG_TYPE_FOR_VAR
 
153
SET @@session.query_prealloc_size   = "test";
 
154
SELECT @@session.query_prealloc_size  ;
 
155
 
 
156
 
 
157
--echo '#------------------FN_DYNVARS_005_06-----------------------#'
 
158
####################################################################
 
159
#   Check if the value in GLOBAL Table matches value in variable   #
 
160
####################################################################
 
161
 
 
162
 
 
163
SELECT @@global.query_prealloc_size   = VARIABLE_VALUE
 
164
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
 
165
WHERE VARIABLE_NAME='query_prealloc_size  ';
 
166
 
 
167
--echo '#------------------FN_DYNVARS_005_07-----------------------#'
 
168
####################################################################
 
169
#  Check if the value in SESSION Table matches value in variable   #
 
170
####################################################################
 
171
 
 
172
SELECT @@session.query_prealloc_size   = VARIABLE_VALUE
 
173
FROM INFORMATION_SCHEMA.SESSION_VARIABLES
 
174
WHERE VARIABLE_NAME='query_prealloc_size  ';
 
175
 
 
176
 
 
177
--echo '#------------------FN_DYNVARS_005_08-----------------------#'
 
178
####################################################################
 
179
#     Check if TRUE and FALSE values can be used on variable       #
 
180
####################################################################
 
181
 
 
182
SET @@global.query_prealloc_size   = TRUE;
 
183
SELECT @@global.query_prealloc_size  ;
 
184
SET @@global.query_prealloc_size   = FALSE;
 
185
SELECT @@global.query_prealloc_size  ;
 
186
 
 
187
 
 
188
 
 
189
--echo '#---------------------FN_DYNVARS_001_09----------------------#'
 
190
################################################################################
 
191
# Check if accessing variable with and without GLOBAL point to same variable   #
 
192
################################################################################
 
193
 
 
194
SET @@global.query_prealloc_size   = 10;
 
195
SELECT @@query_prealloc_size   = @@global.query_prealloc_size  ;
 
196
 
 
197
 
 
198
--echo '#---------------------FN_DYNVARS_001_10----------------------#'
 
199
##############################################################################
 
200
# Check if accessing variable with SESSION,LOCAL and without SCOPE points to #
 
201
# to the same session variable                                               #
 
202
##############################################################################
 
203
 
 
204
SET @@query_prealloc_size   = 100;
 
205
SELECT @@query_prealloc_size   = @@local.query_prealloc_size  ;
 
206
SELECT @@local.query_prealloc_size   = @@session.query_prealloc_size  ;
 
207
 
 
208
 
 
209
--echo '#---------------------FN_DYNVARS_001_11----------------------#'
 
210
################################################################################
 
211
#    Check if query_prealloc_size   can be accessed with and without @@ sign   #
 
212
################################################################################
 
213
 
 
214
SET query_prealloc_size   = 1;
 
215
SELECT @@query_prealloc_size  ;
 
216
--Error ER_UNKNOWN_TABLE
 
217
 
 
218
SELECT local.query_prealloc_size  ;
 
219
 
 
220
--Error ER_UNKNOWN_TABLE
 
221
SELECT session.query_prealloc_size  ;
 
222
 
 
223
--Error ER_BAD_FIELD_ERROR
 
224
SELECT query_prealloc_size   = @@session.query_prealloc_size  ;
 
225
 
 
226
 
 
227
####################################
 
228
#     Restore initial value        #
 
229
####################################
 
230
 
 
231
SET @@global.query_prealloc_size   = @start_global_value;
 
232
SELECT @@global.query_prealloc_size  ;
 
233
SET @@session.query_prealloc_size   = @start_session_value;
 
234
SELECT @@session.query_prealloc_size  ;
 
235
 
 
236
 
 
237
#############################################################
 
238
#                 END OF query_prealloc_size   TESTS        #
 
239
#############################################################
 
240