~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/join_outer.result

  • Committer: Lee
  • Date: 2008-10-30 22:02:01 UTC
  • mto: (572.1.2 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: lbieber@lbieber-desktop-20081030220201-elb6qprbzpn7c5a4
add my name to the AUTHORS file

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
grp int default NULL,
4
4
a bigint default NULL,
5
5
c char(10) NOT NULL default ''
6
 
);
 
6
) ENGINE=MyISAM;
7
7
INSERT INTO t1 VALUES (1,1,'a'),(2,2,'b'),(2,3,'c'),(3,4,'E'),(3,5,'C'),(3,6,'D'),(NULL,NULL,'');
8
8
create table t2 (id int, a bigint not null, c char(10), d int, primary key (a));
9
9
insert into t2 values (1,1,"a",1),(3,4,"A",4),(3,5,"B",5),(3,6,"C",6),(4,7,"D",7);
91
91
NULL    NULL            NULL    NULL    NULL    NULL
92
92
explain select t1.*,t2.* from t1,t2 where t1.a=t2.a and isnull(t2.a)=1;
93
93
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
94
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    #       Impossible WHERE
 
94
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE
95
95
explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1;
96
96
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
97
 
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    #       
98
 
1       SIMPLE  t2      eq_ref  PRIMARY PRIMARY 8       test.t1.a       #       Using where
 
97
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    7       
 
98
1       SIMPLE  t2      eq_ref  PRIMARY PRIMARY 8       test.t1.a       1       Using where
99
99
select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a);
100
100
grp     a       c       id      a       c       d       a
101
101
1       1       a       1       1       a       1       1
462
462
7       green
463
463
select * from t2 natural join t1;
464
464
color   count   name
465
 
black   5       grape
466
465
green   10      lime
467
466
green   7       lime
 
467
black   5       grape
468
468
select t2.count, t1.name from t2 natural join t1;
469
469
count   name
470
470
10      lime
 
471
7       lime
471
472
5       grape
472
 
7       lime
473
473
select t2.count, t1.name from t2 inner join t1 using (color);
474
474
count   name
475
475
10      lime
 
476
7       lime
476
477
5       grape
477
 
7       lime
478
478
drop table t1;
479
479
drop table t2;
480
480
CREATE TABLE t1 (
788
788
a       b       c
789
789
1       11      NULL
790
790
drop table t1, t2;
791
 
CREATE TEMPORARY TABLE t1 (
 
791
CREATE TABLE t1 (
792
792
ts_id bigint default NULL,
793
793
inst_id int default NULL,
794
794
flag_name varchar(64) default NULL,
795
795
flag_value text,
796
796
UNIQUE KEY ts_id (ts_id,inst_id,flag_name)
797
797
) ENGINE=MyISAM;
798
 
CREATE TEMPORARY TABLE t2 (
 
798
CREATE TABLE t2 (
799
799
ts_id bigint default NULL,
800
800
inst_id int default NULL,
801
801
flag_name varchar(64) default NULL,
1189
1189
4       ddddddd
1190
1190
show status like 'Handler_read%';
1191
1191
Variable_name   Value
1192
 
Handler_read_first      #
1193
 
Handler_read_key        #
1194
 
Handler_read_next       #
1195
 
Handler_read_prev       #
1196
 
Handler_read_rnd        #
1197
 
Handler_read_rnd_next   #
 
1192
Handler_read_first      1
 
1193
Handler_read_key        8
 
1194
Handler_read_next       0
 
1195
Handler_read_prev       0
 
1196
Handler_read_rnd        0
 
1197
Handler_read_rnd_next   6
1198
1198
DROP TABLE t1,t2;
1199
1199
CREATE TABLE t1 (c int  PRIMARY KEY, e int NOT NULL);
1200
1200
INSERT INTO t1 VALUES (1,0), (2,1);