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

maintenance:mimetype:update-db --repair-filecache not repairing filecache #31693

Open
PotcFdk opened this issue Jun 8, 2018 · 4 comments
Open
Labels
Milestone

Comments

@PotcFdk
Copy link

PotcFdk commented Jun 8, 2018

Steps to reproduce

run occ maintenance:mimetype:update-db --repair-filecache

Expected behaviour

Files ending in .extension should have their mimetype field set to the configured one.

Actual behaviour

The field is left untouched, because the SQL queries that run are generated by this line

$update->createFunction('LOWER(`name`)'), $update->createNamedParameter($ext)

and end up looking like [...] WHERE [...] (LOWER(name) LIKE 'extension') (note the field name contains the full file name, not just the extension, so this query doesn't match any rows).

I don't really have a good overview regarding the source code, so I can't tell why it's not using this logic here, which looks more correct. Maybe I might be missing something; but why is this implemented twice in different places?:

\OC_DB::executeAudited(self::updateByNameStmt(), [$mimetypeId, $this->folderMimeTypeId, $mimetypeId, '%.' . $extension]);

Server configuration

Operating system: Ubuntu
Database: MariaDB
ownCloud version: 10.0.8

@ownclouders
Copy link
Contributor

GitMate.io thinks the contributor most likely able to help you is @PVince81.

Possibly related issues are #20661 (Update), #21366 (Update), #27585 (mimetype:update-db changes a folder to "audio/*"), #22729 (Improve mimetype repair performance), and #24430 (Maintenance mode).

@PotcFdk
Copy link
Author

PotcFdk commented Jun 8, 2018

Note that this issue was fixed in Nextcloud a long time ago nextcloud/server@65efb38#diff-9ff70cb4d5b322bf49c1c086f8903219

@PVince81 PVince81 added this to the backlog milestone Jun 11, 2018
@ownclouders
Copy link
Contributor

Hey, this issue has been closed because the label status/STALE is set and there were no updates for 7 days. Feel free to reopen this issue if you deem it appropriate.

(This is an automated comment from GitMate.io.)

@PotcFdk
Copy link
Author

PotcFdk commented Jul 20, 2018

Not fixed yet, please reopen.

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

No branches or pull requests

3 participants