[MDEV-2346] LP:806510 - Wrong result with derived table, impossible where , derived_merge=on and EXISTS in maria-5.3 Created: 2011-07-06 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: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Requires derived_merge=on .Not repeatable before WL#106 . The following query SELECT * returns no rows when executed with derived merge and 1 row when executed with no derived table or with derived_merge=off. Explain:
minimal optimizer switch: derived_merge=off 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=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=on,mrr_cost_based=off,mrr_sort_keys=on,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=on,table_elimination=on test case: CREATE TABLE t1 ( f3 int) ; CREATE TABLE t2 ( f2 int) ; CREATE TABLE t3 ( f2 int, f3 int) ; SELECT * |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2011-07-06 ] | ||||||||||||||||||||||||||||||
|
Re: Wrong result with derived table, impossible where , derived_merge=on and EXISTS in maria-5.3 | ||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2011-07-08 ] | ||||||||||||||||||||||||||||||
|
Re: Wrong result with derived table, impossible where , derived_merge=on and EXISTS in maria-5.3 MariaDB [test]> CREATE VIEW v2 AS SELECT * FROM t2; MariaDB [test]> EXPLAIN SELECT * FROM v2 AS alias1 WHERE EXISTS ( SELECT t3.f2 FROM t3 , t1 WHERE t1.f3 = t3.f3 AND alias1.f2 != 0 );
---
--- | ||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2011-07-09 ] | ||||||||||||||||||||||||||||||
|
Re: Wrong result with derived table, impossible where , derived_merge=on and EXISTS in maria-5.3 The following demonstrates this for rev #3048: MariaDB [test]> CREATE TABLE t1 (a int) ; MariaDB [test]> INSERT INTO t1 VALUES (4), (NULL); MariaDB [test]> CREATE TABLE t2 (a int) ; MariaDB [test]> INSERT INTO t2 VALUES (8), (0); MariaDB [test]> CREATE TABLE t3 (a int, b int) ; MariaDB [test]> INSERT INTO t3 VALUES (7,8); MariaDB [test]> CREATE VIEW v1 AS SELECT * FROM t1; MariaDB [test]> SELECT * FROM v1 t MariaDB [test]> EXPLAIN
---
--- | ||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||||||||||||||||||||||||
|
Launchpad bug id: 806510 |