~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/select_found.result

  • Committer: Stewart Smith
  • Date: 2008-12-22 02:08:18 UTC
  • mto: This revision was merged to the branch mainline in revision 728.
  • Revision ID: stewart@flamingspork.com-20081222020818-l3hvusjzea3fxsaj
fix select_found test for innodb (and other engines) by adding order by (so that result set is same as myisam)

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
`kid` int NOT NULL default '0',
74
74
PRIMARY KEY (`id`),
75
75
KEY `kid` (`kid`)
76
 
) engine=myisam;
 
76
);
77
77
CREATE TABLE t2 (
78
78
id int NOT NULL auto_increment,
79
79
name varchar(50) NOT NULL default '',
80
80
email varchar(50) NOT NULL default '',
81
81
PRIMARY KEY  (id),
82
82
UNIQUE KEY e_n (email,name)
83
 
) engine=myisam;
84
 
EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1  ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
 
83
);
 
84
EXPLAIN SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1  ON kid = t2.id WHERE t1.id IS NULL ORDER BY t2.email LIMIT 10;
85
85
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
86
 
1       SIMPLE  t1      system  PRIMARY,kid     NULL    NULL    NULL    0       const row not found
87
 
1       SIMPLE  t2      index   NULL    e_n     404     NULL    10      
88
 
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1  ON kid = t2.id WHERE t1.id IS NULL LIMIT 10;
 
86
1       SIMPLE  t2      index   NULL    PRIMARY 4       NULL    200     Using temporary; Using filesort
 
87
1       SIMPLE  t1      ref     kid     kid     4       test.t2.id      1       Using where; Using index; Not exists; Distinct
 
88
SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1  ON kid = t2.id WHERE t1.id IS NULL ORDER BY t2.email  LIMIT 10;
89
89
email
90
90
email1
91
91
email10