~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to mysql-test/include/index_merge_ror_cpk.inc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
126
126
 
127
127
drop table t1;
128
128
 
 
129
--echo #
 
130
--echo # Bug#50402 Optimizer producing wrong results when using Index Merge on InnoDB
 
131
--echo #
 
132
CREATE TABLE t1 (f1 INT, PRIMARY KEY (f1));
 
133
INSERT INTO t1 VALUES (2);
 
134
CREATE TABLE t2 (f1 INT, f2 INT, f3 char(1),
 
135
                 PRIMARY KEY (f1), KEY (f2), KEY (f3) );
 
136
INSERT INTO t2 VALUES (1, 1, 'h'), (2, 3, 'h'), (3, 2, ''), (4, 2, '');
 
137
 
 
138
SELECT t1.f1 FROM t1
 
139
WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
 
140
 
 
141
EXPLAIN SELECT t1.f1 FROM t1
 
142
WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2;
 
143
 
 
144
DROP TABLE t1,t2;