~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to tests/r/null_key.result

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
1       SIMPLE  t1      range   a,b     a       9       NULL    3       Using where; Using index
22
22
explain select * from t1 where (a is null or a = 7) and b=7;
23
23
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
24
 
1       SIMPLE  t1      ref_or_null     a,b     a       9       const,const     2       Using index
 
24
1       SIMPLE  t1      ref_or_null     a,b     a       9       const,const     2       Using where; Using index
25
25
explain select * from t1 where (a is null or a = 7) and b=7 order by a;
26
26
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
27
 
1       SIMPLE  t1      ref_or_null     a,b     a       9       const,const     2       Using index; Using filesort
 
27
1       SIMPLE  t1      ref_or_null     a,b     a       9       const,const     2       Using where; Using index; Using filesort
28
28
explain select * from t1 where (a is null and b>a) or a is null and b=7 limit 2;
29
29
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
30
30
1       SIMPLE  t1      ref     a,b     a       5       const   3       Using where; Using index
77
77
show create table t2;
78
78
Table   Create Table
79
79
t2      CREATE TEMPORARY TABLE `t2` (
80
 
  `a` int DEFAULT NULL,
81
 
  `b` int NOT NULL,
 
80
  `a` INT DEFAULT NULL,
 
81
  `b` INT NOT NULL,
82
82
  UNIQUE KEY `a` (`a`,`b`),
83
83
  KEY `b` (`b`)
84
 
) ENGINE=MyISAM
 
84
) ENGINE=MyISAM COLLATE = utf8_general_ci
85
85
insert into t2 select * from t1;
86
86
alter table t1 modify b blob not null, add c int not null, drop key a, add unique key (a,b(20),c), drop key b, add key (b(10));
87
87
explain select * from t1 where a is null and b = 2;
162
162
insert into t1 values (7,null), (8,null), (8,7);
163
163
explain select * from t1 where a = 7 and (b=7 or b is null);
164
164
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
165
 
1       SIMPLE  t1      ref_or_null     a,b     a       10      const,const     2       Using index
 
165
1       SIMPLE  t1      ref_or_null     a,b     a       10      const,const     2       Using where; Using index
166
166
select * from t1 where a = 7 and (b=7 or b is null);
167
167
a       b
168
168
7       NULL
174
174
7       NULL
175
175
explain select * from t1 where (a = 7 or a is null) and (a = 7 or a is null);
176
176
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
177
 
1       SIMPLE  t1      ref_or_null     a       a       5       const   2       Using index
 
177
1       SIMPLE  t1      ref_or_null     a       a       5       const   2       Using where; Using index
178
178
select * from t1 where (a = 7 or a is null) and (a = 7 or a is null);
179
179
a       b
180
180
7       NULL
196
196
explain select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null);
197
197
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
198
198
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    X       
199
 
1       SIMPLE  t1      ref_or_null     a       a       10      test.t2.a,const X       Using index
 
199
1       SIMPLE  t1      ref_or_null     a       a       10      test.t2.a,const X       Using where; Using index
200
200
select * from t2,t1 where t1.a=t2.a and (b= 7 or b is null);
201
201
a       a       b
202
202
7       7       NULL
205
205
explain select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7;
206
206
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
207
207
1       SIMPLE  t2      ALL     NULL    NULL    NULL    NULL    X       
208
 
1       SIMPLE  t1      ref_or_null     a       a       10      test.t2.a,const X       Using index
 
208
1       SIMPLE  t1      ref_or_null     a       a       10      test.t2.a,const X       Using where; Using index
209
209
select * from t2,t1 where (t1.a=t2.a or t1.a is null) and b= 7;
210
210
a       a       b
211
211
8       8       7
405
405
Handler_read_next       2
406
406
Handler_read_prev       0
407
407
Handler_read_rnd        0
408
 
Handler_read_rnd_next   11
 
408
Handler_read_rnd_next   5
409
409
DROP TABLE t1,t2,t3,t4;
410
410
CREATE TABLE t1 (
411
411
a int default NULL,