~vkolesnikov/pbxt/pbxt-07-diskfull

« back to all changes in this revision

Viewing changes to pbxt/mysql-test-update/mysql-test/r/ndb_blob.result

  • Committer: paul-mccullagh
  • Date: 2006-10-23 09:14:04 UTC
  • Revision ID: paul-mccullagh-918861e03d351978a9541168a96e58cc826734ee
Initial import

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
drop table if exists t1;
 
2
drop database if exists test2;
 
3
set autocommit=0;
 
4
create table t1 (
 
5
a int not null primary key,
 
6
b text not null,
 
7
c int not null,
 
8
d longblob,
 
9
key (c)
 
10
) engine=ndbcluster;
 
11
set @x0 = '01234567012345670123456701234567';
 
12
set @x0 = concat(@x0,@x0,@x0,@x0,@x0,@x0,@x0,@x0);
 
13
set @b1 = 'b1';
 
14
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
 
15
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
 
16
set @b1 = concat(@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1,@b1);
 
17
set @b1 = concat(@b1,@x0);
 
18
set @d1 = 'dd1';
 
19
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
 
20
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
 
21
set @d1 = concat(@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1,@d1);
 
22
set @b2 = 'b2';
 
23
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
 
24
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
 
25
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
 
26
set @b2 = concat(@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2,@b2);
 
27
set @d2 = 'dd2';
 
28
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
 
29
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
 
30
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
 
31
set @d2 = concat(@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2,@d2);
 
32
select length(@x0),length(@b1),length(@d1) from dual;
 
33
length(@x0)     length(@b1)     length(@d1)
 
34
256     2256    3000
 
35
select length(@x0),length(@b2),length(@d2) from dual;
 
36
length(@x0)     length(@b2)     length(@d2)
 
37
256     20000   30000
 
38
insert into t1 values(1,@b1,111,@d1);
 
39
insert into t1 values(2,@b2,222,@d2);
 
40
commit;
 
41
explain select * from t1 where a = 1;
 
42
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
43
1       SIMPLE  t1      const   PRIMARY PRIMARY 4       const   1       
 
44
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
45
from t1 where a=1;
 
46
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
47
1       2256    b1      3000    dd1
 
48
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
49
from t1 where a=2;
 
50
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
51
2       20000   b2      30000   dd2
 
52
update t1 set b=@b2,d=@d2 where a=1;
 
53
update t1 set b=@b1,d=@d1 where a=2;
 
54
commit;
 
55
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
56
from t1 where a=1;
 
57
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
58
1       20000   b2      30000   dd2
 
59
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
60
from t1 where a=2;
 
61
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
62
2       2256    b1      3000    dd1
 
63
update t1 set b=concat(b,b),d=concat(d,d) where a=1;
 
64
update t1 set b=concat(b,b),d=concat(d,d) where a=2;
 
65
commit;
 
66
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
 
67
from t1 where a=1;
 
68
a       length(b)       substr(b,1+4*9000,2)    length(d)       substr(d,1+6*9000,3)
 
69
1       40000   b2      60000   dd2
 
70
select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
 
71
from t1 where a=2;
 
72
a       length(b)       substr(b,1+4*900,2)     length(d)       substr(d,1+6*900,3)
 
73
2       4512    b1      6000    dd1
 
74
update t1 set d=null where a=1;
 
75
commit;
 
76
select a from t1 where d is null;
 
77
a
 
78
1
 
79
delete from t1 where a=1;
 
80
delete from t1 where a=2;
 
81
commit;
 
82
select count(*) from t1;
 
83
count(*)
 
84
0
 
85
replace t1 set a=1,b=@b1,c=111,d=@d1;
 
86
replace t1 set a=2,b=@b2,c=222,d=@d2;
 
87
commit;
 
88
explain select * from t1 where a = 1;
 
89
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
90
1       SIMPLE  t1      const   PRIMARY PRIMARY 4       const   1       
 
91
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
92
from t1 where a=1;
 
93
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
94
1       2256    b1      3000    dd1
 
95
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
96
from t1 where a=2;
 
97
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
98
2       20000   b2      30000   dd2
 
99
replace t1 set a=1,b=@b2,c=111,d=@d2;
 
100
replace t1 set a=2,b=@b1,c=222,d=@d1;
 
101
commit;
 
102
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
103
from t1 where a=1;
 
104
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
105
1       20000   b2      30000   dd2
 
106
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
107
from t1 where a=2;
 
108
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
109
2       2256    b1      3000    dd1
 
110
replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2);
 
111
replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1);
 
112
commit;
 
113
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
 
114
from t1 where a=1;
 
115
a       length(b)       substr(b,1+4*9000,2)    length(d)       substr(d,1+6*9000,3)
 
116
1       40000   b2      60000   dd2
 
117
select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3)
 
118
from t1 where a=2;
 
119
a       length(b)       substr(b,1+4*900,2)     length(d)       substr(d,1+6*900,3)
 
120
2       4512    b1      6000    dd1
 
121
replace t1 set a=1,b='xyz',c=111,d=null;
 
122
commit;
 
123
select a,b from t1 where d is null;
 
124
a       b
 
125
1       xyz
 
126
delete from t1 where a=1;
 
127
delete from t1 where a=2;
 
128
commit;
 
129
select count(*) from t1;
 
130
count(*)
 
131
0
 
132
insert into t1 values(1,@b1,111,@d1);
 
133
insert into t1 values(2,@b2,222,@d2);
 
134
commit;
 
135
explain select * from t1 where c = 111;
 
136
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
137
1       SIMPLE  t1      ref     c       c       4       const   1       
 
138
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
139
from t1 where c=111;
 
140
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
141
1       2256    b1      3000    dd1
 
142
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
143
from t1 where c=222;
 
144
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
145
2       20000   b2      30000   dd2
 
146
update t1 set b=@b2,d=@d2 where c=111;
 
147
update t1 set b=@b1,d=@d1 where c=222;
 
148
commit;
 
149
select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3)
 
150
from t1 where c=111;
 
151
a       length(b)       substr(b,1+2*9000,2)    length(d)       substr(d,1+3*9000,3)
 
152
1       20000   b2      30000   dd2
 
153
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
154
from t1 where c=222;
 
155
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
156
2       2256    b1      3000    dd1
 
157
update t1 set d=null where c=111;
 
158
commit;
 
159
select a from t1 where d is null;
 
160
a
 
161
1
 
162
delete from t1 where c=111;
 
163
delete from t1 where c=222;
 
164
commit;
 
165
select count(*) from t1;
 
166
count(*)
 
167
0
 
168
insert into t1 values(1,'b1',111,'dd1');
 
169
insert into t1 values(2,'b2',222,'dd2');
 
170
insert into t1 values(3,'b3',333,'dd3');
 
171
insert into t1 values(4,'b4',444,'dd4');
 
172
insert into t1 values(5,'b5',555,'dd5');
 
173
insert into t1 values(6,'b6',666,'dd6');
 
174
insert into t1 values(7,'b7',777,'dd7');
 
175
insert into t1 values(8,'b8',888,'dd8');
 
176
insert into t1 values(9,'b9',999,'dd9');
 
177
commit;
 
178
explain select * from t1;
 
179
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
180
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    9       
 
181
select * from t1 order by a;
 
182
a       b       c       d
 
183
1       b1      111     dd1
 
184
2       b2      222     dd2
 
185
3       b3      333     dd3
 
186
4       b4      444     dd4
 
187
5       b5      555     dd5
 
188
6       b6      666     dd6
 
189
7       b7      777     dd7
 
190
8       b8      888     dd8
 
191
9       b9      999     dd9
 
192
update t1 set b=concat(a,'x',b),d=concat(a,'x',d);
 
193
commit;
 
194
select * from t1 order by a;
 
195
a       b       c       d
 
196
1       1xb1    111     1xdd1
 
197
2       2xb2    222     2xdd2
 
198
3       3xb3    333     3xdd3
 
199
4       4xb4    444     4xdd4
 
200
5       5xb5    555     5xdd5
 
201
6       6xb6    666     6xdd6
 
202
7       7xb7    777     7xdd7
 
203
8       8xb8    888     8xdd8
 
204
9       9xb9    999     9xdd9
 
205
delete from t1;
 
206
commit;
 
207
select count(*) from t1;
 
208
count(*)
 
209
0
 
210
insert into t1 values(1,@b1,111,@d1);
 
211
insert into t1 values(2,@b2,222,@d2);
 
212
commit;
 
213
explain select * from t1;
 
214
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
215
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    2       
 
216
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
217
from t1 order by a;
 
218
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
219
1       2256    b1      3000    dd1
 
220
2       20000   b2      30000   dd2
 
221
update t1 set b=concat(b,b),d=concat(d,d);
 
222
commit;
 
223
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
 
224
from t1 order by a;
 
225
a       length(b)       substr(b,1+4*9000,2)    length(d)       substr(d,1+6*9000,3)
 
226
1       4512            6000    
 
227
2       40000   b2      60000   dd2
 
228
delete from t1;
 
229
commit;
 
230
select count(*) from t1;
 
231
count(*)
 
232
0
 
233
insert into t1 values(1,'b1',111,'dd1');
 
234
insert into t1 values(2,'b2',222,'dd2');
 
235
insert into t1 values(3,'b3',333,'dd3');
 
236
insert into t1 values(4,'b4',444,'dd4');
 
237
insert into t1 values(5,'b5',555,'dd5');
 
238
insert into t1 values(6,'b6',666,'dd6');
 
239
insert into t1 values(7,'b7',777,'dd7');
 
240
insert into t1 values(8,'b8',888,'dd8');
 
241
insert into t1 values(9,'b9',999,'dd9');
 
242
commit;
 
243
explain select * from t1 where c >= 100 order by a;
 
244
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
245
1       SIMPLE  t1      range   c       c       4       NULL    9       Using where; Using filesort
 
246
select * from t1 where c >= 100 order by a;
 
247
a       b       c       d
 
248
1       b1      111     dd1
 
249
2       b2      222     dd2
 
250
3       b3      333     dd3
 
251
4       b4      444     dd4
 
252
5       b5      555     dd5
 
253
6       b6      666     dd6
 
254
7       b7      777     dd7
 
255
8       b8      888     dd8
 
256
9       b9      999     dd9
 
257
update t1 set b=concat(a,'x',b),d=concat(a,'x',d)
 
258
where c >= 100;
 
259
commit;
 
260
select * from t1 where c >= 100 order by a;
 
261
a       b       c       d
 
262
1       1xb1    111     1xdd1
 
263
2       2xb2    222     2xdd2
 
264
3       3xb3    333     3xdd3
 
265
4       4xb4    444     4xdd4
 
266
5       5xb5    555     5xdd5
 
267
6       6xb6    666     6xdd6
 
268
7       7xb7    777     7xdd7
 
269
8       8xb8    888     8xdd8
 
270
9       9xb9    999     9xdd9
 
271
delete from t1 where c >= 100;
 
272
commit;
 
273
select count(*) from t1;
 
274
count(*)
 
275
0
 
276
insert into t1 values(1,@b1,111,@d1);
 
277
insert into t1 values(2,@b2,222,@d2);
 
278
commit;
 
279
explain select * from t1 where c >= 100 order by a;
 
280
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
281
1       SIMPLE  t1      range   c       c       4       NULL    2       Using where; Using filesort
 
282
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
283
from t1 where c >= 100 order by a;
 
284
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
285
1       2256    b1      3000    dd1
 
286
2       20000   b2      30000   dd2
 
287
update t1 set b=concat(b,b),d=concat(d,d);
 
288
commit;
 
289
select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3)
 
290
from t1 where c >= 100 order by a;
 
291
a       length(b)       substr(b,1+4*9000,2)    length(d)       substr(d,1+6*9000,3)
 
292
1       4512            6000    
 
293
2       40000   b2      60000   dd2
 
294
delete from t1 where c >= 100;
 
295
commit;
 
296
select count(*) from t1;
 
297
count(*)
 
298
0
 
299
insert into t1 values(1,@b1,111,@d1);
 
300
insert into t1 values(2,@b2,222,@d2);
 
301
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
302
from t1 where a = 0;
 
303
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
304
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
305
from t1 where a = 1;
 
306
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
307
1       2256    b1      3000    dd1
 
308
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
309
from t1 where a = 2;
 
310
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
311
2       20000   b2      30000   dd2
 
312
select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3)
 
313
from t1 order by a;
 
314
a       length(b)       substr(b,1+2*900,2)     length(d)       substr(d,1+3*900,3)
 
315
1       2256    b1      3000    dd1
 
316
2       20000   b2      30000   dd2
 
317
rollback;
 
318
select count(*) from t1;
 
319
count(*)
 
320
0
 
321
insert into t1 values(1,'b1',111,'dd1');
 
322
insert into t1 values(2,'b2',222,'dd2');
 
323
insert into t1 values(3,'b3',333,'dd3');
 
324
insert into t1 values(4,'b4',444,'dd4');
 
325
insert into t1 values(5,'b5',555,'dd5');
 
326
insert into t1 values(6,'b6',666,'dd6');
 
327
insert into t1 values(7,'b7',777,'dd7');
 
328
insert into t1 values(8,'b8',888,'dd8');
 
329
insert into t1 values(9,'b9',999,'dd9');
 
330
commit;
 
331
select * from t1 order by a;
 
332
a       b       c       d
 
333
1       b1      111     dd1
 
334
2       b2      222     dd2
 
335
3       b3      333     dd3
 
336
4       b4      444     dd4
 
337
5       b5      555     dd5
 
338
6       b6      666     dd6
 
339
7       b7      777     dd7
 
340
8       b8      888     dd8
 
341
9       b9      999     dd9
 
342
alter table t1 add x int;
 
343
select * from t1 order by a;
 
344
a       b       c       d       x
 
345
1       b1      111     dd1     NULL
 
346
2       b2      222     dd2     NULL
 
347
3       b3      333     dd3     NULL
 
348
4       b4      444     dd4     NULL
 
349
5       b5      555     dd5     NULL
 
350
6       b6      666     dd6     NULL
 
351
7       b7      777     dd7     NULL
 
352
8       b8      888     dd8     NULL
 
353
9       b9      999     dd9     NULL
 
354
alter table t1 drop x;
 
355
select * from t1 order by a;
 
356
a       b       c       d
 
357
1       b1      111     dd1
 
358
2       b2      222     dd2
 
359
3       b3      333     dd3
 
360
4       b4      444     dd4
 
361
5       b5      555     dd5
 
362
6       b6      666     dd6
 
363
7       b7      777     dd7
 
364
8       b8      888     dd8
 
365
9       b9      999     dd9
 
366
create database test2;
 
367
use test2;
 
368
CREATE TABLE t2 (
 
369
a bigint unsigned NOT NULL PRIMARY KEY,
 
370
b int unsigned not null,
 
371
c int unsigned
 
372
) engine=ndbcluster;
 
373
insert into t2 values (1,1,1),(2,2,2);
 
374
select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a;
 
375
a       b       c       d       a       b       c
 
376
1       b1      111     dd1     1       1       1
 
377
2       b2      222     dd2     2       2       2
 
378
drop table t2;
 
379
use test;
 
380
select * from t1 order by a;
 
381
a       b       c       d
 
382
1       b1      111     dd1
 
383
2       b2      222     dd2
 
384
3       b3      333     dd3
 
385
4       b4      444     dd4
 
386
5       b5      555     dd5
 
387
6       b6      666     dd6
 
388
7       b7      777     dd7
 
389
8       b8      888     dd8
 
390
9       b9      999     dd9
 
391
alter table t1 add x int;
 
392
select * from t1 order by a;
 
393
a       b       c       d       x
 
394
1       b1      111     dd1     NULL
 
395
2       b2      222     dd2     NULL
 
396
3       b3      333     dd3     NULL
 
397
4       b4      444     dd4     NULL
 
398
5       b5      555     dd5     NULL
 
399
6       b6      666     dd6     NULL
 
400
7       b7      777     dd7     NULL
 
401
8       b8      888     dd8     NULL
 
402
9       b9      999     dd9     NULL
 
403
alter table t1 drop x;
 
404
select * from t1 order by a;
 
405
a       b       c       d
 
406
1       b1      111     dd1
 
407
2       b2      222     dd2
 
408
3       b3      333     dd3
 
409
4       b4      444     dd4
 
410
5       b5      555     dd5
 
411
6       b6      666     dd6
 
412
7       b7      777     dd7
 
413
8       b8      888     dd8
 
414
9       b9      999     dd9
 
415
drop table t1;
 
416
drop database test2;
 
417
set autocommit=0;
 
418
create table t1 (
 
419
a int not null primary key,
 
420
b tinytext
 
421
) engine=ndbcluster;
 
422
insert into t1 values(1, 'x');
 
423
update t1 set b = 'y';
 
424
select * from t1;
 
425
a       b
 
426
1       y
 
427
delete from t1;
 
428
select * from t1;
 
429
a       b
 
430
commit;
 
431
replace t1 set a=2, b='y';
 
432
select * from t1;
 
433
a       b
 
434
2       y
 
435
delete from t1;
 
436
select * from t1;
 
437
a       b
 
438
drop table t1;
 
439
set autocommit=0;
 
440
create table t1 (
 
441
a int not null primary key,
 
442
b text not null
 
443
) engine=ndbcluster;
 
444
insert into t1 values(1, '');
 
445
select * from t1;
 
446
a       b
 
447
1       
 
448
commit;
 
449
drop table t1;
 
450
set autocommit=1;
 
451
use test;
 
452
CREATE TABLE t1 (
 
453
a int,
 
454
b text,
 
455
PRIMARY KEY  (a)
 
456
) ENGINE=PBXT DEFAULT CHARSET=latin1;
 
457
INSERT INTO t1 VALUES 
 
458
(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
 
459
INSERT INTO t1 VALUES 
 
460
(2,'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB');
 
461
select * from t1 order by a;
 
462
a       b
 
463
1       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
464
2       BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 
465
alter table t1 engine=ndb;
 
466
select * from t1 order by a;
 
467
a       b
 
468
1       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
469
2       BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 
470
set autocommit=1;
 
471
alter table t1 engine=myisam;
 
472
select * from t1 order by a;
 
473
a       b
 
474
1       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
475
2       BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
 
476
drop table t1;
 
477
create table t1 (
 
478
id int(11) unsigned primary key NOT NULL auto_increment,
 
479
msg text NOT NULL
 
480
) engine=ndbcluster default charset=utf8;
 
481
insert into t1 (msg) values(
 
482
'Tries to validate (8 byte length + inline bytes) as UTF8 :(
 
483
Fast fix: removed validation for Text.  It is not yet indexable
 
484
so bad data will not crash kernel.');
 
485
select * from t1;
 
486
id      msg
 
487
1       Tries to validate (8 byte length + inline bytes) as UTF8 :(
 
488
Fast fix: removed validation for Text.  It is not yet indexable
 
489
so bad data will not crash kernel.
 
490
drop table t1;
 
491
create table t1 (
 
492
a int primary key not null auto_increment,
 
493
b text
 
494
) engine=ndbcluster;
 
495
select count(*) from t1;
 
496
count(*)
 
497
500
 
498
truncate t1;
 
499
select count(*) from t1;
 
500
count(*)
 
501
0
 
502
drop table t1;
 
503
create table t1 (
 
504
a varchar(40) not null,
 
505
b mediumint not null,
 
506
t text,
 
507
c varchar(2) not null,
 
508
d bigint not null,
 
509
primary key (a,b,c),
 
510
key (c,a),
 
511
unique key (d)
 
512
) engine=ndb;
 
513
insert into t1 (a,b,c,d,t) values ('a',1110,'a',1,@v1);
 
514
insert into t1 (a,b,c,d,t) values ('b',1110,'a',2,@v2);
 
515
insert into t1 (a,b,c,d,t) values ('a',1110,'b',3,@v3);
 
516
insert into t1 (a,b,c,d,t) values ('b',1110,'b',4,@v4);
 
517
select a,b,c,d,sha1(t) from t1 order by c,a;
 
518
a       b       c       d       sha1(t)
 
519
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
520
b       1110    a       2       b238654911689bfb626a3ef9dba4a1ca074e6a5e
 
521
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
522
b       1110    b       4       NULL
 
523
select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='a';
 
524
a       b       c       d       sha1(t)
 
525
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
526
select a,b,c,d,sha1(t) from t1 where a='a' and b=1110 and c='b';
 
527
a       b       c       d       sha1(t)
 
528
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
529
update t1 set t=@v4 where a='b' and b=1110 and c='a';
 
530
update t1 set t=@v2 where a='b' and b=1110 and c='b';
 
531
select a,b,c,d,sha1(t) from t1 order by c,a;
 
532
a       b       c       d       sha1(t)
 
533
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
534
b       1110    a       2       NULL
 
535
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
536
b       1110    b       4       b238654911689bfb626a3ef9dba4a1ca074e6a5e
 
537
update t1 set t=@v2 where d=2;
 
538
update t1 set t=@v4 where d=4;
 
539
select a,b,c,d,sha1(t) from t1 order by c,a;
 
540
a       b       c       d       sha1(t)
 
541
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
542
b       1110    a       2       b238654911689bfb626a3ef9dba4a1ca074e6a5e
 
543
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
544
b       1110    b       4       NULL
 
545
update t1 set t=@v4 where a='b' and c='a';
 
546
update t1 set t=@v2 where a='b' and c='b';
 
547
select a,b,c,d,sha1(t) from t1 order by c,a;
 
548
a       b       c       d       sha1(t)
 
549
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
550
b       1110    a       2       NULL
 
551
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
552
b       1110    b       4       b238654911689bfb626a3ef9dba4a1ca074e6a5e
 
553
update t1 set t=@v2 where b+d=1112;
 
554
update t1 set t=@v4 where b+d=1114;
 
555
select a,b,c,d,sha1(t) from t1 order by c,a;
 
556
a       b       c       d       sha1(t)
 
557
a       1110    a       1       558a30713786aa72f66abc1e6a521d55aacdeeb5
 
558
b       1110    a       2       b238654911689bfb626a3ef9dba4a1ca074e6a5e
 
559
a       1110    b       3       2b6515f29c20b8e9e17cc597527e516c0de8d612
 
560
b       1110    b       4       NULL
 
561
delete from t1 where a='a' and b=1110 and c='a';
 
562
delete from t1 where a='b' and c='a';
 
563
delete from t1 where d=3;
 
564
delete from t1 where b+d=1114;
 
565
select count(*) from t1;
 
566
count(*)
 
567
0
 
568
drop table t1;