[MDEV-5112] InnoDB index intersection returns less results than expected Created: 2013-10-08 Updated: 2014-04-22 Resolved: 2013-10-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.4, 5.5.33a |
| Fix Version/s: | 5.5.34, 10.0.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Arnaud Gadal | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Environment: |
Debian GNU/Linux 6.0 |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
This bug affects MariaDB 5.5.3x perhaps older versions too. This bug concerns also all MySQL 5.6 versions (>= 5.6.8), it will be fixed on 5.6.14 : http://bugs.mysql.com/bug.php?id=69581 The test case below comes from the above link :
With index_merge=on you obtain :
but you should obtain what you have when you disable index_merge :
|
| Comments |
| Comment by Elena Stepanova [ 2013-10-08 ] |
|
Thanks for the report |
| Comment by Igor Babaev [ 2013-10-19 ] |
|
Version 5.1,5.2,5.3 of MariaDB are not affected. |
| Comment by Igor Babaev [ 2013-10-20 ] |
|
This problem appeared in the MariaDB 5.5 tree right after the merge with MySQL 5.5.29 in revision 3624 (rev 3623 was not yet affected). |
| Comment by Igor Babaev [ 2013-10-20 ] |
|
Here are my findings. === modified file 'sql/ha_partition.cc' resolves the problem, What remains unclear for me is why this test case does not fail for MySQL 5.5 that does not have this patch applied. Why we don't see the problem in MariaDB 5.3 is more or less clear: we have some code there that was removed in 5.5 when merging |
| Comment by Sergei Petrunia [ 2013-10-23 ] |
|
The fix in mysql-5.6 is incomplete. I've filed http://bugs.mysql.com/bug.php?id=70703 which demonstrates how to get the wrong result again. |
| Comment by Sergei Petrunia [ 2013-10-23 ] |
|
I have investigated why mysql-5.5 doesn't produce a wrong result. It has quick->sorted= false However, this wrong value is not a problem because handler::m_ordered=false. When no ordered output is requested, ha_partition does a variant of index scan that produces records in no particular order (e.g. it uses handle_unordered_scan_next_partition). That variant doesn't care about value of m_pkey_is_clustered. In post-MRR versions (MariaDB 5.5+, MySQL 5.6+) merged QUICK_RANGE_SELECTs have mrr_is_output_sorted=true. The code in ha_partition that does index scan and produces ordered output does depend on m_pkey_is_clustered. |
| Comment by Sergei Petrunia [ 2013-10-23 ] |
|
MariaDB's counterpart for http://bugs.mysql.com/bug.php?id=70703 is |
| Comment by Sergei Petrunia [ 2013-10-24 ] |
|
Pushed the fix for this particular bug (but not for |