-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Escape underscore in archive name when used in like query #21495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, can confirm this solves the issue with the custom report archiving log entries.
Is there a test we can adjust or add to make sure this doesn't regress in future? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change (either the original one or the suggested one) solves the issue, so approving. It'd be nice if there was a test covering this.
Co-authored-by: Michal Kleiner <michal@innocraft.com>
@michalkleiner There are currently no tests that are covering that part of the code directly, so there isn't anything that could be extended easily. Also the problem is, that core doesn't contain any record names that end with a dynamic number. That is only the case for custom reports plugin. Tests in custom reports plugin actually kind of covered this, but as it "only" causes an info message being logged and no further problems that wasn't caught earlier. |
* Escape underscore in archive name when used in like query * apply review feedback Co-authored-by: Michal Kleiner <michal@innocraft.com> --------- Co-authored-by: Michal Kleiner <michal@innocraft.com>
Description:
The ArchiveSelector is responsible for selecting related archives based on the record name. It should select the archive itself, but also all chunks and subtables.
The generated where statement might currently look like this:
Problem with this query currently is, that the record name in the like query contains (unescaped) underscores (
_
). MySQL interprets them as a single char wildcard and the records such might also match e.g.CustomReports_customreport_100_0
This one maybe should be backported to 4.x-dev
fixes L3-590
Review