[MDEV-4355] Wrong result (extra row) with AND and OR conditions Created: 2013-04-03 Updated: 2013-09-15 Resolved: 2013-08-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 10.0.5, 5.5.33, 5.3.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | optimizer | ||
| Issue Links: |
|
||||||||||||
| Description |
|
It is most likely a regression introduced (or made visible) by the following revision:
I cannot verify it with 100% certainty because the provided test case causes a crash on revisions 3628..3634; but it produces a correct result on maria/5.3 up to revno 3627 and a wrong result starting from revno 3635 and up to (and including) the current 3646. Test case:
Actual result:
Expected result - empty set:
Inconsistency of the actual result can be confirmed by executing the second part of AND separately:
It is a correct result, and it doesn't include the row with a=5, so the result set for the bigger query cannot include it either (but currently it does). Reproducible with the default optimizer_switch as well as with all OFF values. EXPLAIN:
|
| Comments |
| Comment by Patryk Pomykalski [ 2013-07-06 ] |
|
I came up with a fix, not sure if it solves the real problem... === modified file 'sql/sql_select.cc' else |
| Comment by Sergei Golubchik [ 2013-07-10 ] |
|
paste from the IRC: <serg> can you explain what the problem is? |
| Comment by Patryk Pomykalski [ 2013-07-12 ] |
|
Maybe mdev-4177 should be reverted until it's fixed properly? |
| Comment by Igor Babaev [ 2013-07-12 ] |
|
Patryk, |
| Comment by Patryk Pomykalski [ 2013-07-12 ] |
|
We haven't upgraded to MariaDB yet, just testing it in dev environment. No problems yet, but it's hard to test everything with ~20 applications and a lot of generated queries. We hope to migrate to 5.5.32, thanks for the good work |
| Comment by Igor Babaev [ 2013-08-21 ] |
|
The fix for this bug was pushed into the 5.3 tree and later merged into the 5.5 tree. |