[Commits] Rev 3090: Back-ported the test case for bug #12616253 from mariadb-5.3 that in file:///home/igor/maria/maria-5.2/

Igor Babaev igor at askmonty.org
Sat Jan 14 10:02:02 EET 2012


At file:///home/igor/maria/maria-5.2/

------------------------------------------------------------
revno: 3090
revision-id: igor at askmonty.org-20120114080202-decn3zpnuvtckbk0
parent: igor at askmonty.org-20120114030050-jabx25n2fopqjnen
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.2
timestamp: Sat 2012-01-14 00:02:02 -0800
message:
  Back-ported the test case for bug #12616253 from mariadb-5.3 that
  was actually a duplicate of LP bug #888456 fixed in mariadb-5.2.
-------------- next part --------------
=== modified file 'mysql-test/r/subselect.result'
--- a/mysql-test/r/subselect.result	2012-01-14 03:00:50 +0000
+++ b/mysql-test/r/subselect.result	2012-01-14 08:02:02 +0000
@@ -5155,4 +5155,45 @@
 1	PRIMARY	t1	ALL	NULL	NULL	NULL	NULL	4	
 2	SUBQUERY	t1	ref	a	a	5	const	1	Using where; Using index
 DROP TABLE t1;
+#
+# BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
+# (duplicate of LP bug #888456)
+CREATE TABLE t1 (f1 varchar(1));
+INSERT INTO t1 VALUES ('v'),('s');
+CREATE TABLE t2 (f1_key varchar(1), KEY (f1_key));
+INSERT INTO t2 VALUES ('j'),('v'),('c'),('m'),('d'),
+('d'),('y'),('t'),('d'),('s');
+EXPLAIN
+SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2
+WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 
+WHERE f1_key != table2.f1_key AND f1_key >= table1.f1);
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	PRIMARY	table1	ALL	NULL	NULL	NULL	NULL	2	
+1	PRIMARY	table2	index	NULL	f1_key	4	NULL	10	Using where; Using index; Using join buffer
+2	DEPENDENT SUBQUERY	t2	index	f1_key	f1_key	4	NULL	10	Using where; Using index; Using temporary
+SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2
+WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 
+WHERE f1_key != table2.f1_key AND f1_key >= table1.f1);
+f1	f1_key
+v	j
+s	j
+v	v
+s	v
+v	c
+s	c
+v	m
+s	m
+v	d
+s	d
+v	d
+s	d
+v	y
+s	y
+v	t
+s	t
+v	d
+s	d
+v	s
+s	s
+DROP TABLE t1,t2;
 End of 5.2 tests

=== modified file 'mysql-test/t/subselect.test'
--- a/mysql-test/t/subselect.test	2012-01-14 03:00:50 +0000
+++ b/mysql-test/t/subselect.test	2012-01-14 08:02:02 +0000
@@ -4022,4 +4022,25 @@
 
 DROP TABLE t1;
 
+--echo #
+--echo # BUG#12616253 - WRONG RESULT WITH EXISTS(SUBQUERY) (MISSING ROWS)
+--echo # (duplicate of LP bug #888456)
+
+CREATE TABLE t1 (f1 varchar(1));
+INSERT INTO t1 VALUES ('v'),('s');
+
+CREATE TABLE t2 (f1_key varchar(1), KEY (f1_key));
+INSERT INTO t2 VALUES ('j'),('v'),('c'),('m'),('d'),
+('d'),('y'),('t'),('d'),('s');
+
+EXPLAIN
+SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2
+  WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 
+                  WHERE f1_key != table2.f1_key AND f1_key >= table1.f1);
+SELECT table1.f1, table2.f1_key FROM t1 AS table1, t2 AS table2
+  WHERE EXISTS (SELECT DISTINCT f1_key FROM t2 
+                  WHERE f1_key != table2.f1_key AND f1_key >= table1.f1);
+
+DROP TABLE t1,t2;
+
 --echo End of 5.2 tests



More information about the commits mailing list