[MDEV-765] LP:825075 - Wrong result with multipart key + MIN/MAX loose scan and OR expression in WHERE Created: 2011-08-12 Updated: 2013-02-07 Resolved: 2013-02-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.3.9 |
| Fix Version/s: | 5.5.30, 5.2.15, 5.3.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Philip Stoev (Inactive) | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following test case produces wrong result:
|
| Comments |
| Comment by Oleksandr Byelkin [ 2011-10-12 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key +id select_type table type possible_keys key key_len ref rows filtered Extra If reduce test suite table to INSERT INTO t1 VALUES (0,99),(9,99),(4,0),(7,0),(99,0),(7,0),(8,0),(99,0),(1,0); it works correctly with other explain: +id select_type table type possible_keys key key_len ref rows filtered Extra | ||||||||||
| Comment by Philip Stoev (Inactive) [ 2011-10-20 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key DROP TABLE IF EXISTS t1; SELECT a , b FROM t1 WHERE a IS NULL OR b = 'z' ; | ||||||||||
| Comment by Philip Stoev (Inactive) [ 2011-10-20 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key | ||||||||||
| Comment by Oleksandr Byelkin [ 2011-10-25 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key | ||||||||||
| Comment by Sergei Petrunia [ 2011-10-27 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key | ||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2011-12-01 ] | ||||||||||
|
Re: Wrong result with GROUP BY + scalar subquery + multipart key + MIN/MAX loose scan SELECT b, min(a) FROM t1 WHERE a = 7 OR b = 'z' GROUP BY b;
-----
----- While the correct result is: -----
-----
----- | ||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2012-04-05 ] | ||||||||||
|
Launchpad bug id: 825075 | ||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2012-11-09 ] | ||||||||||
|
The bug manifests itself with the above example in MariaDB 5.3. In MariaDB 5.5, MySQL 5.5, and MySQL 5.6 the bug cannot be reproduced directly by the above example because the cost of loose scan is higher than that of index scan. | ||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2012-11-09 ] | ||||||||||
|
There is a patch, the patch has been reviewed by Sergey. The review requires more analysis and possibly a more generic solution. | ||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2013-01-25 ] | ||||||||||
|
The wrong result is present in MariaDB 5.3 and on, and in MySQL 5.5/5.6 (older versions should be affected too). | ||||||||||
| Comment by Sergei Petrunia [ 2013-02-07 ] | ||||||||||
|
They did: "You do not have access to bug #68179." | ||||||||||
| Comment by Timour Katchaounov (Inactive) [ 2013-02-07 ] | ||||||||||
|
pushed to 5.3 |