~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/blitzdb/tests/t/blitzdb-index.test

  • Committer: Andrew Hutchings
  • Date: 2010-09-08 19:03:09 UTC
  • mfrom: (1750 staging)
  • mto: (1750.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1751.
  • Revision ID: andrew@linuxjedi.co.uk-20100908190309-mya1nu7xvo1fpvk8
Merge trunk into branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
explain select count (*) from t1;
19
19
 
20
20
# overflow
21
 
--error 1264
 
21
--error ER_WARN_DATA_OUT_OF_RANGE
22
22
insert into t1 values (2147483648, 1, 1);
23
23
 
24
24
# duplicates 
25
 
--error 1062
 
25
--error ER_DUP_ENTRY
26
26
insert into t1 values (1, 0, 0);
27
 
--error 1062
 
27
--error ER_DUP_ENTRY
28
28
insert into t1 values (2, 0, 0);
29
 
--error 1062
 
29
--error ER_DUP_ENTRY
30
30
insert into t1 values (3, 0, 0);
31
 
--error 1062
 
31
--error ER_DUP_ENTRY
32
32
insert into t1 values (4, 0, 0);
33
33
 
34
34
# needle in a haystack 
42
42
select * from t1 order by id;
43
43
 
44
44
# update the key
45
 
--error 1062
 
45
--error ER_DUP_ENTRY
46
46
update t1 set id = 2 where id = 1;
47
47
 
48
48
update t1 set id = 17 where id = 1;
53
53
update t1 set id = 22 where id = 6;
54
54
update t1 set id = 23 where id = 7;
55
55
 
56
 
--error 1062
 
56
--error ER_DUP_ENTRY
57
57
update t1 set id = 20 where id = 8;
58
58
 
59
59
# TODO: This is using filesort. Investigate why.
100
100
insert into t1 values (1.8e+18, 2);
101
101
 
102
102
# overflow
103
 
--error 1264
 
103
--error ER_WARN_DATA_OUT_OF_RANGE
104
104
insert into t1 values (1.8e+19, 3);
105
105
 
106
106
insert into t1 values (1,1), (2,2), (3,3), (4,4);
107
107
 
108
 
--error 1062
 
108
--error ER_DUP_ENTRY
109
109
update t1 set id = 4 where id = 1;
110
110
 
111
111
update t1 set id = 10 where id = 1;
183
183
insert into t1 values (2.2222, 8);
184
184
select * from t1;
185
185
 
186
 
--error 1062
 
186
--error ER_DUP_ENTRY
187
187
update t1 set id = 1.11 where id = 1.1;
188
 
--error 1062
 
188
--error ER_DUP_ENTRY
189
189
update t1 set id = 2.22 where id = 2.2;
190
190
 
191
191
update t1 set id = 3.3 where id = 1.1;
194
194
update t1 set id = 3.3333 where id = 1.1111;
195
195
select * from t1 order by id;
196
196
 
197
 
--error 1062
 
197
--error ER_DUP_ENTRY
198
198
update t1 set id = 2.2 where id = 3.3;
199
199
 
200
200
delete from t1 where id = 3.3;
225
225
select country from t1 where id = 'budapest';
226
226
select count (id) from t1;
227
227
 
228
 
--error 1062
 
228
--error ER_DUP_ENTRY
229
229
update t1 set id = 'dublin' where id = 'geneva';
230
230
update t1 set id = 'berlin', country = 'germany' where id = 'budapest';
231
231
update t1 set id = 'london', country = 'england' where id = 'copenhagen';
263
263
delete from t1 where a = 'hhh';
264
264
select * from t1;
265
265
 
266
 
--error 1062
 
266
--error ER_DUP_ENTRY
267
267
update t1 set a = 'ddd' where a = 'aaa';
268
 
--error 1062
 
268
--error ER_DUP_ENTRY
269
269
update t1 set a = 'ccc' where a = 'bbb';
270
270
 
271
271
update t1 set a = 'zzz' where a = 'fff';
289
289
select * from t1 where a = '1984-09-24';
290
290
select * from t1 where a = '1984-09-25';
291
291
 
292
 
--error 1062
 
292
--error ER_DUP_ENTRY
293
293
update t1 set a = '1984-09-22' where a = '1984-09-25';
294
 
--error 1062
 
294
--error ER_DUP_ENTRY
295
295
update t1 set a = '19840922' where a = '1984-09-25';
296
296
 
297
297
update t1 set a = '2010-03-10' where a = '1984-09-22';
384
384
create table t1 (a int, unique index(a)) engine = blitzdb;
385
385
insert into t1 values (1), (2);
386
386
 
387
 
--error 1062
 
387
--error ER_DUP_ENTRY
388
388
insert into t1 values (1);
389
 
--error 1062
 
389
--error ER_DUP_ENTRY
390
390
insert into t1 values (2);
391
391
 
392
392
insert into t1 values (NULL);
404
404
create table t1 (a varchar(32), unique index(a)) engine = blitzdb;
405
405
insert into t1 values ('a'), ('b'), ('c');
406
406
 
407
 
--error 1062
 
407
--error ER_DUP_ENTRY
408
408
insert into t1 values ('a');
409
 
--error 1062
 
409
--error ER_DUP_ENTRY
410
410
insert into t1 values ('b');
411
 
--error 1062
 
411
--error ER_DUP_ENTRY
412
412
insert into t1 values ('c');
413
413
 
414
414
insert into t1 values ('f'), ('e'), ('d');
484
484
select * from t1;
485
485
select * from t1 where a is NULL;
486
486
insert into t1 values (1, 5), (2, 6);
487
 
--error 1062
 
487
--error ER_DUP_ENTRY
488
488
insert into t1 values (1, 7), (1, 8);
489
489
select * from t1 where a is not NULL;
490
490
delete from t1 where a is NULL;
522
522
# | COMPOSITE INDEX CHECK |
523
523
# +-----------------------+
524
524
 
525
 
--error 1005
 
525
--error ER_CANT_CREATE_TABLE
526
526
create table t1 (a int, b int, c int, d int, primary key(a, b)) engine = blitzdb;
527
 
--error 1005
 
527
--error ER_CANT_CREATE_TABLE
528
528
create table t1 (a int, b int, c int, d int, primary key(a, b, c)) engine = blitzdb;
529
 
--error 1005
 
529
--error ER_CANT_CREATE_TABLE
530
530
create table t1 (a int, b int, c int, d int, index(a, b)) engine = blitzdb;
531
 
--error 1005
 
531
--error ER_CANT_CREATE_TABLE
532
532
create table t1 (a int, b int, c int, d int, index(a, b, c)) engine = blitzdb;
533
 
--error 1005
 
533
--error ER_CANT_CREATE_TABLE
534
534
create table t1 (a int, b int, c int, d int, unique(a, b)) engine = blitzdb;
535
 
--error 1005
 
535
--error ER_CANT_CREATE_TABLE
536
536
create table t1 (a int, b int, c int, d int, unique(a, b, c)) engine = blitzdb;
537
537
 
538
538
# +------------------------------------------+