~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/func_group.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:
120
120
# The following returned NULL in 4.0.10
121
121
select min(a2) from t1;
122
122
select max(t1.a1), max(t2.a2) from t1, t2;
123
 
select max(t1.a1) from t1, t2 where t1.a1 > 0;
 
123
select max(t1.a1) from t1, t2;
124
124
select max(t2.a2), max(t1.a1) from t1, t2;
125
125
 
126
126
explain select min(a2) from t1;
128
128
 
129
129
insert into t2 values('AAA', 10, 0.5);
130
130
insert into t2 values('BBB', 20, 1.0);
131
 
--sorted_result
132
 
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2 where t1.a1 > 0;
 
131
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2;
133
132
 
134
133
select max(t1.a1), max(t2.a1) from t1, t2 where t2.a2=9;
135
134
select max(t2.a1), max(t1.a1) from t1, t2 where t2.a2=9;
200
199
insert into t2 values('AAA','AAA','AA','AME');
201
200
 
202
201
# Show the table contents
203
 
--sorted_result
204
202
select * from t1;
205
 
--sorted_result
206
203
select * from t2;
207
204
 
208
205
# Queries with min/max functions 
355
352
#select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ;
356
353
#drop table t1;
357
354
 
 
355
 
 
356
create table t1 (a char(10));
 
357
insert into t1 values ('a'),('b'),('c');
 
358
select coercibility(max(a)) from t1;
 
359
drop table t1;
 
360
 
358
361
#
359
362
# Bug #6658 MAX(column) returns incorrect coercibility
360
363
#
361
364
create table t1 (a char);
362
365
insert into t1 values ('a'),('b');
363
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
364
366
show create table t1;
365
367
create table t2 select max(a),min(a) from t1;
366
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
367
368
show create table t2;
368
369
drop table t2;
369
370
create table t2 select concat(a) from t1;
370
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
371
371
show create table t2;
372
372
drop table t2,t1;
373
373
 
423
423
# Bug #5555 GROUP BY enum_field" returns incorrect results
424
424
#
425
425
 
426
 
CREATE TEMPORARY TABLE t1 (
 
426
CREATE TABLE t1 (
427
427
  id int NOT NULL auto_increment,
428
428
  val enum('one','two','three') NOT NULL default 'one',
429
429
  PRIMARY KEY  (id)
442
442
create table t1(a int, b datetime);
443
443
insert into t1 values (1, NOW()), (2, NOW());
444
444
create table t2 select MAX(b) from t1 group by a;
445
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
446
445
show create table t2;
447
446
drop table t1, t2;
448
447
 
613
612
  (3,2,1), (3,2,2), (3,2,3),
614
613
  (3,3,1), (3,3,2), (3,3,3);
615
614
 
616
 
--sorted_result
617
615
SELECT b/c as v, a FROM t1 ORDER BY v;
618
616
SELECT b/c as v, SUM(a) FROM t1 GROUP BY v;
619
617
SELECT SUM(a) FROM t1 GROUP BY b/c;
630
628
CREATE TABLE t2 (a INT PRIMARY KEY, b INT);
631
629
INSERT INTO t2 VALUES (1,1), (3,3);
632
630
 
633
 
--sorted_result
634
631
SELECT 
635
632
  (SELECT SUM(c.a) FROM t1 ttt, t2 ccc 
636
633
   WHERE ttt.a = ccc.b AND ttt.a = t.a GROUP BY ttt.a) AS minid   
643
640
#
644
641
 
645
642
create table t1 select variance(0);                                               
646
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
647
643
show create table t1;                                                           
648
644
drop table t1;                                                                  
649
645
create table t1 select stddev(0);
650
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
651
646
show create table t1;
652
647
drop table t1;
653
648