14
14
insert into t1 values (9, 9, 9), (10, 10, 10), (11, 11, 11), (12, 12, 12);
15
15
insert into t1 values (13, 13, 13), (14, 14, 14), (15, 15, 15), (16, 16, 16);
17
# this statement should be 'optimized away'.
18
explain select count (*) from t1;
21
--error ER_WARN_DATA_OUT_OF_RANGE
22
19
insert into t1 values (2147483648, 1, 1);
26
23
insert into t1 values (1, 0, 0);
28
25
insert into t1 values (2, 0, 0);
30
27
insert into t1 values (3, 0, 0);
32
29
insert into t1 values (4, 0, 0);
34
31
# needle in a haystack
73
70
select count (a) from t1;
74
71
select count (b) from t1;
75
72
select * from t1 order by id;
78
delete from t1 where id > 10 and id < 14;
79
select * from t1 order by id;
80
select count (*) from t1;
81
delete from t1 where id >= 20 and id <= 23;
82
select * from t1 order by id;
83
select count (*) from t1;
86
delete from t1 where a > 20;
87
select count(*) from t1;
74
select count (*) from t1;
91
77
# +---------------------+
100
86
insert into t1 values (1.8e+18, 2);
103
--error ER_WARN_DATA_OUT_OF_RANGE
104
90
insert into t1 values (1.8e+19, 3);
106
92
insert into t1 values (1,1), (2,2), (3,3), (4,4);
109
95
update t1 set id = 4 where id = 1;
111
97
update t1 set id = 10 where id = 1;
404
385
create table t1 (a varchar(32), unique index(a)) engine = blitzdb;
405
386
insert into t1 values ('a'), ('b'), ('c');
408
389
insert into t1 values ('a');
410
391
insert into t1 values ('b');
412
393
insert into t1 values ('c');
414
395
insert into t1 values ('f'), ('e'), ('d');
476
457
select count(*) from t1;
479
# +-----------------+
480
# | INDEX: VARTEXT1 |
481
# +-----------------+
482
create table t1 (a varchar(32), index(a)) engine = blitzdb;
483
insert into t1 values ('ccc'), ('bbb'), ('aaa');
484
insert into t1 values ('eee'), ('ddd'), ('fff');
487
select * from t1 where a = 'aaa';
488
select * from t1 where a = 'bbb';
489
select * from t1 where a = 'ccc';
490
select * from t1 where a = 'ddd';
491
select * from t1 where a = 'eee';
492
delete from t1 where a = 'ddd';
493
delete from t1 where a = 'eee';
495
select count(*) from t1;
498
460
# +------------------------------+
499
461
# | UNIQUE INDEX: DUPLICATE NULL |
500
462
# +------------------------------+
503
465
select * from t1;
504
466
select * from t1 where a is NULL;
505
467
insert into t1 values (1, 5), (2, 6);
507
469
insert into t1 values (1, 7), (1, 8);
508
470
select * from t1 where a is not NULL;
509
471
delete from t1 where a is NULL;
541
503
# | COMPOSITE INDEX CHECK |
542
504
# +-----------------------+
544
--error ER_CANT_CREATE_TABLE
545
507
create table t1 (a int, b int, c int, d int, primary key(a, b)) engine = blitzdb;
546
--error ER_CANT_CREATE_TABLE
547
509
create table t1 (a int, b int, c int, d int, primary key(a, b, c)) engine = blitzdb;
548
--error ER_CANT_CREATE_TABLE
549
511
create table t1 (a int, b int, c int, d int, index(a, b)) engine = blitzdb;
550
--error ER_CANT_CREATE_TABLE
551
513
create table t1 (a int, b int, c int, d int, index(a, b, c)) engine = blitzdb;
552
--error ER_CANT_CREATE_TABLE
553
515
create table t1 (a int, b int, c int, d int, unique(a, b)) engine = blitzdb;
554
--error ER_CANT_CREATE_TABLE
555
517
create table t1 (a int, b int, c int, d int, unique(a, b, c)) engine = blitzdb;
557
# +------------------------------------------+
558
# | LARGE KEYS : Testcase from Patrick Crews |
559
# +------------------------------------------+
562
`col_varchar_10_key` varchar(10),
564
`col_varchar_1024_key` varchar(1024),
565
pk integer auto_increment,
566
`col_varchar_10` varchar(10),
568
`col_varchar_1024` varchar(1024),
569
key (`col_varchar_10_key`),
571
key (`col_varchar_1024_key`),
575
insert /*! IGNORE */ into t1 values ('x', NULL, 'keyone', NULL, 'could', 1322188800, 'I\'m');
576
insert /*! IGNORE */ into t1 values ('y', NULL, 'keytwo', NULL, 'could', 1322188800, 'I\'m');
577
insert /*! IGNORE */ into t1 values ('z', NULL, 'keythree', NULL, 'could', 1322188800, 'I\'m');