Wrong result with semijoin + nested subqueries in maria-5.3

Bug #784723 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Undecided
Sergey Petrunia

Bug Description

As reported by Igor:

This test case:

CREATE TABLE t1 ( t1field integer, primary key (t1field));
CREATE TABLE t2 ( t2field integer, primary key (t2field));
INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t2 VALUES (2),(3),(4);
SELECT * FROM t1 A WHERE A.t1field IN (SELECT A.t1field FROM t2 B) AND A.t1field IN (SELECT C.t2field FROM t2 C WHERE C.t2field IN (SELECT D.t2field FROM t2 D));

produces 6 rows with semijoin=on, which is more than the size of the base table that is being filtered by the WHERE.

Changed in maria:
assignee: nobody → Sergey Petrunia (sergefp)
milestone: none → 5.3
summary: - Wrong result with semijoin + nested subqueries
+ Wrong result with semijoin + nested subqueries in maria-5.3
Revision history for this message
Sergey Petrunia (sergefp) wrote :

@@Join_cache_level setting has no effect on the problem.

The following patch:

revision-id: <email address hidden>
parent: <email address hidden>
committer: Sergey Petrunya <email address hidden>
branch nick: maria-5.3-subqueries-r42
timestamp: Mon 2011-05-09 11:20:51 +0100
message:
  Change "disable semi-joins in presense of outer joins" check to actually
  check for outer joins (and not for any "t1 SOME_JOIN t2 ON cond" syntax).

also has no relationship to the problem (the bug is repeatable both with it and without)

Changed in maria:
status: New → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.