[MDEV-2784] LP:901032 - Wrong result for MIN/MAX on an indexed column with materialization and semijoin 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: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query SELECT MIN(a) FROM t1, t2 produces NULL while running with materialization=on and semijoin=on, and a numeric result otherwise. The latter is correct. revno: 3334 Reproducible on 3315 as well. Minimal optimizer_switch: none required (materialization=on and semijoin=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 EXPLAIN EXTENDED SELECT MIN(a) FROM t1, t2 Explain without materialization or without semijoin (correct result): id select_type table type possible_keys key key_len ref rows Extra Test case: CREATE TABLE t1 ( a INT, KEY(a) ); SELECT MIN(a) FROM t1, t2
CREATE TABLE t1 ( a INT, KEY(a) ); SELECT MIN(alias1.a) FROM t1 alias1, t1 alias2 |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 901032 |