[MDEV-2275] LP:901312 - Wrong result with derived_merge=ON, RIGHT JOIN Created: 2011-12-07 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: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT alias1.* FROM Returns NULLs instead of numeric column values with derived_merge=ON, and correct values with derived_merge=OFF. EXPLAIN with derived_merge=ON: 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 select `test`.`t1`.`a` AS `a` from `test`.`t2` semi join (`test`.`t3`) left join (`test`.`t1`) on((`test`.`t1`.`a` = `test`.`t2`.`b`)) where 1 EXPLAIN with derived_merge=OFF: 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 select `alias1`.`a` AS `a` from `test`.`t2` semi join (`test`.`t3`) left join (select `test`.`t1`.`a` AS `a` from `test`.`t1`) `alias1` on(((`alias1`.`a` = `test`.`t2`.`b`) and (`test`.`t2`.`b` is not null))) where 1 Minimal optimizer_switch: none needed (derived_merge=ON by default) 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=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,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 Test case: CREATE TABLE t1 (a INT); SELECT alias1.* FROM bzr version-info: revision-id: <email address hidden> |
| Comments |
| Comment by Igor Babaev [ 2011-12-09 ] | |||||||||
|
Re: Wrong result with derived_merge=ON, RIGHT JOIN MariaDB [test]> SELECT alias1.* FROM t1 AS alias1 RIGHT JOIN t2 ON ( b = a ) WHERE t2.b IN ( SELECT c FROM t3 );
------
------ MariaDB [test]> SELECT * FROM t1 AS alias1 RIGHT JOIN t2 ON ( b = a ) WHERE t2.b IN ( SELECT c FROM t3);
-----
----- | |||||||||
| Comment by Elena Stepanova [ 2011-12-09 ] | |||||||||
|
Re: Wrong result with derived_merge=ON, RIGHT JOIN | |||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | |||||||||
|
Launchpad bug id: 901312 |