[MDEV-3687] LP:813418 - Wrong result with aggregate + NOT BETWEEN + key Created: 2011-07-20 Updated: 2012-10-04 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: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
Repeatable in mysql-5.1,5.5, maria 5.1, 5.2, 5.5. The following query: SELECT MAX(a) FROM t1 WHERE a NOT BETWEEN 3 AND 9; returns NULL even though there are obviously rows that match the WHERE predicate. explain: id select_type table type possible_keys key key_len ref rows Extra test case: CREATE TABLE t1 (a int, KEY (a)); |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2011-08-23 ] |
|
Re: Wrong result with aggregate + NOT BETWEEN + key |
| Comment by Oleksandr Byelkin [ 2011-09-07 ] |
|
Re: Wrong result with aggregate + NOT BETWEEN + key The problem is not engine related (myisam/aria/innodb return the same result). |
| Comment by Oleksandr Byelkin [ 2011-09-07 ] |
|
Re: Wrong result with aggregate + NOT BETWEEN + key |
| Comment by Oleksandr Byelkin [ 2011-09-08 ] |
|
Re: Wrong result with aggregate + NOT BETWEEN + key /* Update endpoints for MAX/MIN, see function comment. */ does not takes into account that BETWEEN could be negated (Item_func_between inherited from Item_func_opt_neg). |
| Comment by Oleksandr Byelkin [ 2011-09-08 ] |
|
Re: Wrong result with aggregate + NOT BETWEEN + key === modified file 'sql/opt_sum.cc' |
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] |
|
Launchpad bug id: 813418 |