~ubuntu-branches/ubuntu/precise/mysql-5.5/precise-201203300109

« back to all changes in this revision

Viewing changes to mysql-test/suite/sys_vars/r/max_sort_length_func.result

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-11-08 11:31:13 UTC
  • Revision ID: package-import@ubuntu.com-20111108113113-3ulw01fvi4vn8m25
Tags: upstream-5.5.17
ImportĀ upstreamĀ versionĀ 5.5.17

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
SET @start_value= @@global.max_sort_length;
 
2
SET @session_max_sort_length = @@Session.max_sort_length;
 
3
DROP TABLE IF EXISTS t;
 
4
** creating tables **
 
5
CREATE TABLE t
 
6
(
 
7
id INT AUTO_INCREMENT PRIMARY KEY,
 
8
c TEXT(30)
 
9
);
 
10
CREATE TABLE t1
 
11
(
 
12
id INT AUTO_INCREMENT PRIMARY KEY,
 
13
c BLOB(30)
 
14
);
 
15
CREATE TABLE t2
 
16
(
 
17
id INT AUTO_INCREMENT PRIMARY KEY,
 
18
c TEXT(30)
 
19
);
 
20
'#--------------------FN_DYNVARS_098_01-------------------------#'
 
21
** Connecting test_con1 using username 'root' **
 
22
** Connection test_con1 **
 
23
SELECT @@global.max_sort_length = 10;
 
24
@@global.max_sort_length = 10
 
25
0
 
26
SELECT @@session.max_sort_length = 10;
 
27
@@session.max_sort_length = 10
 
28
0
 
29
** Setting value to 30 and inserting data **
 
30
SET @@global.max_sort_length = 30;
 
31
SELECT @@global.max_sort_length;
 
32
@@global.max_sort_length
 
33
30
 
34
INSERT INTO t set c = repeat('x',29);
 
35
INSERT INTO t set c = concat(repeat('x',28),'r','x');
 
36
INSERT INTO t set c = concat(repeat('x',28),'s','y');
 
37
INSERT INTO t set c = concat(repeat('x',28),'g','w');
 
38
SELECT c from t ORDER BY c, id;
 
39
c
 
40
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
41
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
42
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
43
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
44
** Results should be sorted **
 
45
SET @@session.max_sort_length = 29;
 
46
SELECT @@session.max_sort_length;
 
47
@@session.max_sort_length
 
48
29
 
49
INSERT INTO t set c = repeat('x',29);
 
50
INSERT INTO t set c = concat(repeat('x',28),'r','x');
 
51
INSERT INTO t set c = concat(repeat('x',28),'s','y');
 
52
INSERT INTO t set c = concat(repeat('x',28),'g','w');
 
53
SELECT c from t ORDER BY c, id;
 
54
c
 
55
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
56
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
57
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
58
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
59
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
60
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
61
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
62
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
63
** Results should be sorted **
 
64
'#--------------------FN_DYNVARS_098_02-------------------------#'
 
65
** Connecting test_con2 using username 'root' **
 
66
** Connection test_con2 **
 
67
SET @@global.max_sort_length = 30;
 
68
SELECT @@global.max_sort_length;
 
69
@@global.max_sort_length
 
70
30
 
71
INSERT INTO t set c = repeat('x',29);
 
72
INSERT INTO t set c = concat(repeat('x',28),'r','x');
 
73
INSERT INTO t set c = concat(repeat('x',28),'s','y');
 
74
INSERT INTO t set c = concat(repeat('x',28),'g','w');
 
75
SELECT c from t ORDER BY c, id;
 
76
c
 
77
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
78
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
79
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
80
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
81
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
82
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
83
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
84
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
85
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
86
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
87
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
88
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
89
** Results should be sorted **
 
90
SET @@session.max_sort_length = 20;
 
91
SELECT @@session.max_sort_length;
 
92
@@session.max_sort_length
 
93
20
 
94
INSERT INTO t set c = repeat('x',29);
 
95
INSERT INTO t set c = concat(repeat('x',28),'r','x');
 
96
INSERT INTO t set c = concat(repeat('x',28),'s','y');
 
97
INSERT INTO t set c = concat(repeat('x',28),'g','w');
 
98
SELECT c from t ORDER BY c, id;
 
99
c
 
100
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
101
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
102
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
103
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
104
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
105
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
106
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
107
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
108
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
109
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
110
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
111
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
112
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
113
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
114
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
115
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
116
** Results should not be sorted **
 
117
'#--------------------FN_DYNVARS_098_03-------------------------#'
 
118
SET max_sort_length=20;
 
119
INSERT INTO t set c = repeat('x',29);
 
120
INSERT INTO t set c = concat(repeat('x',28),'r','x');
 
121
INSERT INTO t set c = concat(repeat('x',28),'s','y');
 
122
INSERT INTO t set c = concat(repeat('x',28),'g','w');
 
123
SELECT c from t ORDER BY c, id;
 
124
c
 
125
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
126
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
127
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
128
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
129
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
130
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
131
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
132
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
133
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
134
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
135
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
136
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
137
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
138
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
139
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
140
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
141
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
142
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
143
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
144
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
145
** Results should not be sorted **
 
146
RESET QUERY CACHE;
 
147
'#--------------------FN_DYNVARS_098_04-------------------------#'
 
148
SET max_sort_length=29;
 
149
SELECT c from t ORDER BY c, id;
 
150
c
 
151
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
152
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
153
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
154
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
155
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
156
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
157
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
158
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
159
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
160
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
161
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
162
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
163
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
164
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
165
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
166
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
167
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
168
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
169
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
170
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
171
** Results should be sorted **
 
172
'#--------------------FN_DYNVARS_098_05-------------------------#'
 
173
SET max_sort_length=30;
 
174
SELECT c from t ORDER BY c, id;
 
175
c
 
176
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
177
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
178
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
179
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
180
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
181
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
182
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
183
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
184
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
185
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
186
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
187
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
188
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
189
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
190
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
191
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
192
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
193
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
194
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
195
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
196
** Results should be sorted **
 
197
'#--------------------FN_DYNVARS_098_06-------------------------#'
 
198
SET max_sort_length=default;
 
199
SELECT c from t ORDER BY c, id;
 
200
c
 
201
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
202
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
203
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
204
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
205
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
206
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
207
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
208
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
209
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
210
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
211
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
212
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
213
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
214
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
215
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
216
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
217
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
218
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
219
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
220
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
221
** Results should be sorted **
 
222
'#--------------------FN_DYNVARS_098_07-------------------------#'
 
223
Testing type BLOB
 
224
SET @@global.max_sort_length = 30;
 
225
SELECT @@global.max_sort_length;
 
226
@@global.max_sort_length
 
227
30
 
228
INSERT INTO t1 set c = repeat('x',29);
 
229
INSERT INTO t1 set c = concat(repeat('x',28),'r','x');
 
230
INSERT INTO t1 set c = concat(repeat('x',28),'s','y');
 
231
INSERT INTO t1 set c = concat(repeat('x',28),'g','w');
 
232
SELECT c from t1 ORDER BY c, id;
 
233
c
 
234
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
235
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
236
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
237
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
238
** Results should be sorted **
 
239
SET @@session.max_sort_length = 20;
 
240
SELECT @@session.max_sort_length;
 
241
@@session.max_sort_length
 
242
20
 
243
INSERT INTO t1 set c = repeat('x',29);
 
244
INSERT INTO t1 set c = concat(repeat('x',28),'r','x');
 
245
INSERT INTO t1 set c = concat(repeat('x',28),'s','y');
 
246
INSERT INTO t1 set c = concat(repeat('x',28),'g','w');
 
247
SELECT c from t1 ORDER BY c, id;
 
248
c
 
249
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
250
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
251
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
252
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
253
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
254
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
255
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
256
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
257
** Results should not be sorted **
 
258
'#--------------------FN_DYNVARS_098_08-------------------------#'
 
259
Testing type CHAR
 
260
SET @@global.max_sort_length = 30;
 
261
SELECT @@global.max_sort_length;
 
262
@@global.max_sort_length
 
263
30
 
264
INSERT INTO t2 set c = repeat('x',29);
 
265
INSERT INTO t2 set c = concat(repeat('x',28),'r','x');
 
266
INSERT INTO t2 set c = concat(repeat('x',28),'s','y');
 
267
INSERT INTO t2 set c = concat(repeat('x',28),'g','w');
 
268
SELECT c from t2 ORDER BY c, id;
 
269
c
 
270
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
271
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
272
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
273
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
274
** Results should not be sorted **
 
275
SET @@session.max_sort_length = 20;
 
276
SELECT @@session.max_sort_length;
 
277
@@session.max_sort_length
 
278
20
 
279
INSERT INTO t2 set c = repeat('x',29);
 
280
INSERT INTO t2 set c = concat(repeat('x',28),'r','x');
 
281
INSERT INTO t2 set c = concat(repeat('x',28),'s','y');
 
282
INSERT INTO t2 set c = concat(repeat('x',28),'g','w');
 
283
SELECT c from t2 ORDER BY c, id;
 
284
c
 
285
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
286
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
287
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
288
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
289
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 
290
xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
 
291
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
 
292
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
 
293
** Results should not be sorted **
 
294
** Connection default **
 
295
** Disconnecting test_con1, test_con2 **
 
296
SET @@SESSION.max_sort_length = @session_max_sort_length;
 
297
DROP TABLE IF EXISTS t;
 
298
DROP TABLE IF EXISTS t1;
 
299
DROP TABLE IF EXISTS t2;
 
300
SET @@global.max_sort_length= @start_value;