Skip to content
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

escape path prefix when doing cache jail search #34924

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

icewind1991
Copy link
Member

Currently the CacheJail doesn't escape the path of the jail when creating the search query for the files inside the jail. This doesn't break things since at most it will make the sql query return a few more results which will be filtered out in later steps.

It does however interfere with the optimization step that is required for mysql to be able to use the "path prefix" index on the search query. Which does properly like-escape the paths.

This causes the "path prefix" index to not be used when a cache jail with an "_" in the path is part of the search. (This also includes any groupfolders since those always have "__groupfolders" in the search path)

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label Nov 2, 2022
@icewind1991 icewind1991 added this to the Nextcloud 26 milestone Nov 2, 2022
@icewind1991 icewind1991 requested review from a team, juliusknorr, CarlSchwan and come-nc and removed request for a team November 2, 2022 11:50
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense 👍

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@PVince81 PVince81 merged commit 3b7cc31 into master Dec 16, 2022
@PVince81 PVince81 deleted the cache-jail-path-prefix branch December 16, 2022 16:27
@PVince81
Copy link
Member

PVince81 commented Dec 16, 2022

/backport to stable25

@PVince81
Copy link
Member

/backport to stable24

@backportbot-nextcloud
Copy link

The backport to stabe25 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable24 failed. Please do this backport manually.

@icewind1991
Copy link
Member Author

/backport to stable25

@icewind1991
Copy link
Member Author

/backport to stable24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants