[MDEV-3523] LP:833702 - Wrong result with nested IN and singlerow subqueries and equality propagation Created: 2011-08-25 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query: SELECT * FROM t2 returns no rows. Expected result: -----
-----
----- explain: ---
---
--- Not influenced by any particular switch. full optimizer_switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on bzr version-info: revision-id: <email address hidden> test case: CREATE TABLE t2 ( c int , a int, b int); CREATE TABLE t3 ( a int, b int) ; CREATE TABLE t4 (a int); SELECT * FROM t2 Reproducible with maria-5.3. Not reproducible with maria 5.2, mysql-5.5. Does not involve NULLS, empty or constant tables. |
| Comments |
| Comment by Sergei Petrunia [ 2011-08-26 ] | ||||||
|
Re: Wrong result with nested correlated subqueries, OR condition Seems to be a generic subquery code problem. | ||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-10-28 ] | ||||||
|
Re: Wrong result with nested correlated subqueries, OR condition Also the OR in the outer query is not relevant. The following simpler example demonstrates this: set @@optimizer_switch='in_to_exists=off,materialization=on';
-----
----- set @@optimizer_switch='in_to_exists=on,materialization=off'; => empty result | ||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-10-30 ] | ||||||
|
Re: Wrong result with nested correlated subqueries, OR condition set @@optimizer_switch='in_to_exists=off,materialization=on,subquery_cache=off'; set @@optimizer_switch='in_to_exists=on,materialization=off,subquery_cache=off'; SELECT * FROM t2 WHERE t2.b IN (SELECT b FROM t3 WHERE a < ANY (SELECT * FROM t4) and t3.a = 7); | ||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-11-01 ] | ||||||
|
Launchpad bug id: 833702 |