[MDEV-8063] Unconditional ANALYZE DELETE does not delete rows Created: 2015-04-28 Updated: 2015-05-19 Resolved: 2015-05-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Admin statements |
| Affects Version/s: | 10.1 |
| Fix Version/s: | 10.1.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Vicențiu Ciorbaru |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | verified | ||
| Description |
|
|
| Comments |
| Comment by Vicențiu Ciorbaru [ 2015-05-18 ] | ||||||||
|
After investigating this issue, I am in a bit of a predicament. First, according to our documentation, analyze delete and update should perform the updates or deletes. It is my understanding that this is a technical limitation as we sometimes need to actually perform the operation, in order for us to report all the statistics produced by analyze statement. However, after examining the code, we have all sorts of interesting inconsistencies, where we actually prefer to not execute anything. I am for not executing the query plan, but it is not consistent with the documentation.
This part lacks any handling for the analyze_stmt flag. I think this is an oversight, yet here we specifically prefer to not execute the query plan. Nonetheless, I have produced a patch that fixes the behavior so that we do perform the delete. | ||||||||
| Comment by Sergei Petrunia [ 2015-05-18 ] | ||||||||
|
> However, after examining the code, we have all sorts of interesting inconsistencies, where we actually prefer to not execute anything. I don't see any inconsistencies in the quoted code. We produce the query plan. Then, if we are in EXPLAIN statement, we jump to the code that prints the query plan and leaves. If we are not in EXPLAIN (i.e. we are in an actual DELETE or in ANALYZE DELETE), we execute the code. | ||||||||
| Comment by Vicențiu Ciorbaru [ 2015-05-19 ] | ||||||||
|
Fixed with: Two patches in this case due to a wrong push with the first patch. |