~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/having.test

  • Committer: Brian Aker
  • Date: 2008-10-20 00:12:43 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020001243-i230wqhwdwh3jfmk
A bunch more test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#
19
19
 
20
20
CREATE TABLE t1 (
21
 
  raw_id int(10) NOT NULL default '0',
22
 
  chr_start int(10) NOT NULL default '0',
23
 
  chr_end int(10) NOT NULL default '0',
24
 
  raw_start int(10) NOT NULL default '0',
25
 
  raw_end int(10) NOT NULL default '0',
26
 
  raw_ori int(2) NOT NULL default '0'
 
21
  raw_id int NOT NULL default '0',
 
22
  chr_start int NOT NULL default '0',
 
23
  chr_end int NOT NULL default '0',
 
24
  raw_start int NOT NULL default '0',
 
25
  raw_end int NOT NULL default '0',
 
26
  raw_ori int NOT NULL default '0'
27
27
);
28
28
 
29
29
INSERT INTO t1 VALUES (469713,1,164123,1,164123,1),(317330,164124,317193,101,153170,1),(469434,317194,375620,101,58527,1),(591816,375621,484273,1,108653,1),(591807,484274,534671,91,50488,1),(318885,534672,649362,101,114791,1),(318728,649363,775520,102,126259,1),(336829,775521,813997,101,38577,1),(317740,813998,953227,101,139330,1),(1,813998,953227,101,139330,1);
30
30
 
31
31
CREATE TABLE t2 (
32
 
  id int(10) NOT NULL default '0',
33
 
  contig_id int(10) NOT NULL default '0',
34
 
  seq_start int(10) NOT NULL default '0',
35
 
  seq_end int(10) NOT NULL default '0',
36
 
  strand int(2) NOT NULL default '0',
 
32
  id int NOT NULL default '0',
 
33
  contig_id int NOT NULL default '0',
 
34
  seq_start int NOT NULL default '0',
 
35
  seq_end int NOT NULL default '0',
 
36
  strand int NOT NULL default '0',
37
37
  KEY id (id)
38
38
);
39
39
INSERT INTO t2 VALUES (133195,469713,61327,61384,1),(133196,469713,64113,64387,1),(133197,1,1,1,0),(133197,1,1,1,-2);
57
57
# Test problem with having and MAX() IS NOT NULL
58
58
#
59
59
 
60
 
CREATE TABLE t1 (Fld1 int(11) default NULL,Fld2 int(11) default NULL);
 
60
CREATE TABLE t1 (Fld1 int default NULL,Fld2 int default NULL);
61
61
INSERT INTO t1 VALUES (1,10),(1,20),(2,NULL),(2,NULL),(3,50);
62
62
select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null;
63
63
select Fld1, max(Fld2) from t1 group by Fld1 having max(Fld2) is not null;
82
82
#
83
83
 
84
84
CREATE TABLE t1 (
85
 
  `id` bigint(20) NOT NULL default '0',
 
85
  `id` bigint NOT NULL default '0',
86
86
  `description` text
87
87
) ENGINE=MyISAM;
88
88
 
89
89
CREATE TABLE t2 (
90
 
  `id` bigint(20) NOT NULL default '0',
 
90
  `id` bigint NOT NULL default '0',
91
91
  `description` varchar(20)
92
92
) ENGINE=MyISAM;
93
93
 
95
95
INSERT INTO t2 VALUES (1, 'test');
96
96
 
97
97
CREATE TABLE t3 (
98
 
  `id`       bigint(20) NOT NULL default '0',
99
 
  `order_id` bigint(20) NOT NULL default '0'
 
98
  `id`       bigint NOT NULL default '0',
 
99
  `order_id` bigint NOT NULL default '0'
100
100
) ENGINE=MyISAM;
101
101
 
102
102
select
364
364
 
365
365
drop table t1;
366
366
 
367
 
create table t1 (s1 char character set latin1 collate latin1_german1_ci);
 
367
create table t1 (s1 char);
368
368
insert into t1 values ('b'),('y');
369
369
 
370
 
select s1,count(s1) from t1
371
 
group by s1 collate latin1_swedish_ci having s1 = 'y';
 
370
select s1,count(s1) from t1 group by s1 having s1 = 'y';
372
371
# ANSI requires: 1 row, with count(s1) = 2
373
372
# MySQL returns: 1 row, with count(s1) = 1
374
373