[MDEV-10228] Delete missing rows with OR conditions Created: 2016-06-14 Updated: 2016-09-19 Resolved: 2016-07-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Delete |
| Affects Version/s: | 10.0.25, 5.5, 10.0, 10.1, 10.2 |
| Fix Version/s: | 5.5.51, 10.1.17, 10.0.27 |
| Type: | Bug | Priority: | Critical |
| Reporter: | ebial@navista.fr | Assignee: | Sergei Petrunia |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
mariaDB 10.0.25 |
||
| Issue Links: |
|
||||||||
| Sprint: | 10.2.2-3 | ||||||||
| Description |
|
On mariaDB 10.0.25. I've got a problem when i delete some rows with a primary key VARCHAR + INT and a request with AND and OR conditions.
|
| Comments |
| Comment by Elena Stepanova [ 2016-06-15 ] | |||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the report and the test case. The problem was initially introduced in MariaDB 5.5 by a merge of MySQL 5.5.35. The degenerate condition "1 AND" in WHERE is not required to get the wrong result, which makes it more generic and hence important problem:
| |||||||||||||||||||||||||||||||||||||||||||
| Comment by Vicențiu Ciorbaru [ 2016-07-26 ] | |||||||||||||||||||||||||||||||||||||||||||
|
The main difference between when using an InnoDB storage engine and when using a different storage engine, say MyISAM, is that we're using a different query plan. We're making use of an index scan with InnoDB and this leads us to the following selects:
As we can see, for the InnoDB table, we're only looking at one row. A preliminary step through the code indicates a difference when running check_quick_select(). For InnoDB we return a valid option, while MyISAM does not. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2016-07-26 ] | |||||||||||||||||||||||||||||||||||||||||||
|
SELECT is not affected because for SELECT we're using a query plan that uses ref access:
I think the problem is reproducible when range access is not reducible to ref but that would require a bigger table. | |||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2016-07-27 ] | |||||||||||||||||||||||||||||||||||||||||||
|
Fix pushed into 5.5 tree (from there, it will be merged to 10.x versions). |