-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add repair step to fix file share permissions #26562
Conversation
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @nickvergessen, @DeepDiver1975 and @owncloud-bot to be potential reviewers. |
$builder = $this->connection->getQueryBuilder(); | ||
$builder | ||
->update('share') | ||
->set('permissions', $builder->createFunction('permissions & ' . $mask)) |
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.
❗️
According to http://www.orafaq.com/wiki/Bit , Oracle doesn't support that operator. I'm not sure if this is somehow patched in the DB layer.
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.
Yeah, when writing this I wasn't sure but wanted to let it run on CI... CI will confirm.
If we don't have bitmask operations then it will be much more painful to implement.
I'm not happy to have to first gather all shares and then iterate over each and do the combination on PHP level.
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.
To fix postgres $builder->createFunction('(' . $builder->getColumnName('permissions') . ' & ' . $mask . ')'))
should be enough.
But I guess to correctly fix this, you should add a new method to IExpressionBuilder. Then Oracle can haz it's own fucked up implementation.
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.
Thanks for the hints. Doing this inline for now, let's see if the tests pass...
Hah, look... PostgreSQL failed first:
|
Looks like PostgreSQL will needs its own exception too: 😱
|
(Need (more (brackets))) |
Added Let's see... |
); | ||
} else { | ||
$permsFunc = $builder->createFunction( | ||
'cast(' . $builder->getColumnName('permissions') . ' as int) & ' . $mask |
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.
As commented before '(' . $builder->getColumnName('permissions') . ' & ' . $mask . ')'
is what you need...
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.
I wanted to wait for another test run. Oh well, it failed again.
Will try with extra safety brackets.
3a5e859
to
b99f808
Compare
The magic has worked ! Now rebased+squashed. |
@jvillafanez review ? |
👍 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Related Issue
Fixes for #26541.
Motivation and Context
See issue
How Has This Been Tested?
Unit test.
Screenshots (if appropriate):
Types of changes
Checklist:
Backports:
@jvillafanez