~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/group_min_max.test

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
drop table if exists t1;
15
15
--enable_warnings
16
16
 
17
 
create TEMPORARY table t1 (
 
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
 
64
64
drop table if exists t2;
65
65
--enable_warnings
66
66
 
67
 
create TEMPORARY table t2 (
 
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;
101
101
drop table if exists t3;
102
102
--enable_warnings
103
103
 
104
 
create TEMPORARY table t3 (
 
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
 
523
523
# BUG #8532 - SELECT DISTINCT a, a causes server to crash
524
524
select distinct a1,a1 from t1;
525
525
select distinct a2,a1,a2,a1 from t1;
526
 
--sorted_result
527
526
select distinct t1.a1,t2.a1 from t1,t2;
528
527
 
529
528
 
690
689
# Bug #14920 Ordering aggregated result sets with composite primary keys
691
690
# corrupts resultset
692
691
#
693
 
create TEMPORARY table t1 (c1 int not null,c2 int not null, primary key(c1,c2)) ENGINE=MYISAM;
 
692
create table t1 (c1 int not null,c2 int not null, primary key(c1,c2)) ENGINE=MYISAM;
694
693
insert into t1 (c1,c2) values
695
694
(10,1),(10,2),(10,3),(20,4),(20,5),(20,6),(30,7),(30,8),(30,9);
696
695
select distinct c1, c2 from t1 order by c2;
705
704
 
706
705
CREATE TABLE t1 (a varchar(5), b int, PRIMARY KEY (a,b));
707
706
INSERT INTO t1 VALUES ('AA',1), ('AA',2), ('AA',3), ('BB',1), ('AA',4);
708
 
ALTER TABLE t1 ENGINE="DEFAULT";
 
707
OPTIMIZE TABLE t1;
709
708
 
710
709
SELECT a FROM t1 WHERE a='AA' GROUP BY a;
711
710
SELECT a FROM t1 WHERE a='BB' GROUP BY a;
905
904
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
906
905
 
907
906
DROP TABLE t1;
908
 
 
909
 
#
910
 
# Bug #309547 key_infix_len can be overwritten causing some group by 
911
 
# queries return no rows
912
 
 
913
 
CREATE TABLE t1 (a int, b int, c int, d int,
914
 
  KEY foo (c,d,a,b), KEY bar (c,a,b,d));
915
 
 
916
 
INSERT INTO t1 VALUES (1, 1, 1, 1), (1, 1, 1, 2), (1, 1, 1, 3), (1, 1, 1, 4);
917
 
INSERT INTO t1 SELECT * FROM t1;
918
 
INSERT INTO t1 SELECT * FROM t1;
919
 
INSERT INTO t1 SELECT a,b,c+1,d FROM t1;
920
 
 
921
 
#Should be non-empty
922
 
EXPLAIN SELECT DISTINCT c FROM t1 WHERE d=4;
923
 
SELECT DISTINCT c FROM t1 WHERE d=4;
924
 
 
925
 
DROP TABLE t1;