[MDEV-641] LP:1002108 - Wrong result (or crash) from a query with duplicated field in the group list and a limit clause Created: 2012-05-21 Updated: 2013-02-01 Resolved: 2013-02-01 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.5.30, 5.1.73, 5.3.13 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Igor Babaev | Assignee: | Timour Katchaounov (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following test case gives us a wrong result in MariaDB 5.2/5.3/5.5: CREATE TABLE t1( INSERT INTO t1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); SELECT SQL_BIG_RESULT tbl1.col1 AS field1, tbl2.col1 AS field2 (see also bug #53534 in bugs.mysql.com) |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2012-05-21 ] |
|
Launchpad bug id: 1002108 |
| Comment by Timour Katchaounov (Inactive) [ 2013-01-17 ] |
|
Investigation of the bug on various versions, using the following test case (based on the one in MySQL 5.6): INSERT INTO t1m VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10), EXPLAIN SELECT SQL_BIG_RESULT col1 AS field1, col1 AS field2
|
| Comment by Timour Katchaounov (Inactive) [ 2013-01-17 ] |
|
MySQL's fix looks like an optimization that hides the real problem. Investigating. |
| Comment by Timour Katchaounov (Inactive) [ 2013-01-31 ] |
|
The situation described in this bug is quite uncommon, therefore the solution is to make loose scan analysis take into account that there may be duplicate columns. Since there cannot be an index with duplicate columns, loose scan will become inapplicable to group by queries with duplicate group columns. This limitation will be lifted in 10.0 by MDEV-4119. |
| Comment by Timour Katchaounov (Inactive) [ 2013-02-01 ] |
|
Moved fix to 5.1, test, push |