~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/group_min_max.test

  • Committer: Monty Taylor
  • Date: 2008-12-21 04:16:39 UTC
  • mfrom: (726 testable)
  • mto: (722.2.2 devel)
  • mto: This revision was merged to the branch mainline in revision 727.
  • Revision ID: monty@inaugust.com-20081221041639-u1d19wdrq70s5qug
MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
create table t1 (
18
18
  a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
19
 
);
 
19
) ENGINE=MYISAM;
20
20
 
21
21
insert into t1 (a1, a2, b, c, d) values
22
22
('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
66
66
 
67
67
create table t2 (
68
68
  a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' '
69
 
);
 
69
) ENGINE=MYISAM;
70
70
insert into t2 select * from t1;
71
71
# add few rows with NULL's in the MIN/MAX column
72
72
insert into t2 (a1, a2, b, c, d) values
103
103
 
104
104
create table t3 (
105
105
  a1 char(1), a2 char(1), b char(1), c char(4) not null, d char(3), dummy char(1) default ' '
106
 
);
 
106
) ENGINE=MYISAM;
107
107
 
108
108
insert into t3 (a1, a2, b, c, d) values
109
109
('a','a','a','a111','xy1'),('a','a','a','b111','xy2'),('a','a','a','c111','xy3'),('a','a','a','d111','xy4'),
369
369
 
370
370
# queries
371
371
select a1,a2,b,       max(c) from t1 where (c > 'b1') group by a1,a2,b;
372
 
select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
 
372
#select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
373
373
select a1,a2,b,       max(c) from t1 where (c > 'f123') group by a1,a2,b;
374
 
select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
 
374
#select a1,a2,b,min(c),max(c) from t1 where (c > 'f123') group by a1,a2,b;
375
375
select a1,a2,b,       max(c) from t1 where (c < 'a0') group by a1,a2,b;
376
376
select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') group by a1,a2,b;
377
377
select a1,a2,b,       max(c) from t1 where (c < 'k321') group by a1,a2,b;
378
378
select a1,a2,b,min(c),max(c) from t1 where (c < 'k321') group by a1,a2,b;
379
379
select a1,a2,b,       max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
380
 
select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
 
380
#select a1,a2,b,min(c),max(c) from t1 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
381
381
select a1,a2,b,       max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
382
382
select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
383
383
select a1,a2,b,min(c),max(c) from t1 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
437
437
 
438
438
# queries
439
439
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
440
 
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
441
 
select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
 
440
#select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
 
441
#select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
442
442
select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9'))  and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
443
443
select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9'))  and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
444
444
select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
689
689
# Bug #14920 Ordering aggregated result sets with composite primary keys
690
690
# corrupts resultset
691
691
#
692
 
create table t1 (c1 int not null,c2 int not null, primary key(c1,c2));
 
692
create table t1 (c1 int not null,c2 int not null, primary key(c1,c2)) ENGINE=MYISAM;
693
693
insert into t1 (c1,c2) values
694
694
(10,1),(10,2),(10,3),(20,4),(20,5),(20,6),(30,7),(30,8),(30,9);
695
695
select distinct c1, c2 from t1 order by c2;
702
702
#             returns impossible range
703
703
#
704
704
 
705
 
CREATE TABLE t1 (a varchar(5), b int(11), PRIMARY KEY (a,b));
 
705
CREATE TABLE t1 (a varchar(5), b int, PRIMARY KEY (a,b));
706
706
INSERT INTO t1 VALUES ('AA',1), ('AA',2), ('AA',3), ('BB',1), ('AA',4);
707
707
OPTIMIZE TABLE t1;
708
708